{"id":480739,"date":"2026-05-23T10:10:02","date_gmt":"2026-05-23T10:10:02","guid":{"rendered":"https:\/\/savepearlharbor.com\/?p=480739"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=480739","title":{"rendered":"Feature Based Clean Architecture. \u0427\u0430\u0441\u0442\u044c 5: \u041c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 FBCA \u0438 \u0442\u0435\u043e\u0440\u0435\u0442\u0438\u043a\u043e-\u0433\u0440\u0430\u0444\u043e\u0432\u044b\u0439 \u0430\u043d\u0430\u043b\u0438\u0437 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439"},"content":{"rendered":"<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<blockquote>\n<p>\u0410\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u043d\u0430\u044f \u0434\u043e\u043a\u0442\u0440\u0438\u043d\u0430 \u0434\u043b\u044f NestJS-\u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432: \u0440\u0430\u0437\u0431\u043e\u0440 \u0442\u0438\u043f\u043e\u0432\u044b\u0445 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0435\u0432 \u0434\u0435\u0433\u0440\u0430\u0434\u0430\u0446\u0438\u0438 \u043a\u043e\u0434\u043e\u0432\u043e\u0439 \u0431\u0430\u0437\u044b \u0438 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043d\u044b\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f, \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u044e\u0449\u0438\u0435 \u0435\u0451 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u043f\u0440\u0438 \u0440\u043e\u0441\u0442\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u0430.<\/p>\n<\/blockquote>\n<p>\u0412 \u0447\u0430\u0441\u0442\u044f\u0445 1\u20132 \u043c\u044b \u043d\u0430\u0431\u043b\u044e\u0434\u0430\u043b\u0438, \u043a\u0430\u043a \u043f\u0440\u043e\u0441\u0442\u043e\u0439 <code>signUp<\/code> \u043f\u043e\u0434 \u043d\u0430\u043f\u043e\u0440\u043e\u043c \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u0439 \u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0430\u043b\u0441\u044f \u0432 god-\u0441\u0435\u0440\u0432\u0438\u0441 \u043d\u0430 \u0441\u043e\u0442\u043d\u0438 \u0441\u0442\u0440\u043e\u043a, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0437\u043d\u0430\u0435\u0442 \u043f\u0440\u043e \u0434\u0435\u0441\u044f\u0442\u043e\u043a \u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u0441\u0440\u0430\u0437\u0443. \u0412 \u0447\u0430\u0441\u0442\u0438 3 \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u043b\u0438, \u043a\u0430\u043a \u0438\u0437 \u044d\u0442\u043e\u0433\u043e \u0435\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0440\u043e\u0436\u0434\u0430\u044e\u0442\u0441\u044f <code>forwardRef<\/code> \u0438 \u0446\u0438\u043a\u043b\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u2014 \u0442\u043e\u0442 \u0441\u0430\u043c\u044b\u0439 \u043a\u043b\u0443\u0431\u043e\u043a, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0443\u0436\u0435 \u043d\u0435 \u0440\u0430\u0441\u043f\u0443\u0442\u0430\u0442\u044c. \u0412 \u0447\u0430\u0441\u0442\u0438 4 \u0441\u043f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043b\u0438 FBCA-\u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0443 \u0441 \u043d\u0443\u043b\u044f \u2014 <code>domain<\/code> \/ <code>use-case<\/code> \/ <code>infrastructure<\/code> \/ <code>presentation<\/code> \u0441\u043e \u0441\u043b\u043e\u044f\u043c\u0438, external-\u043f\u043e\u0440\u0442\u0430\u043c\u0438 \u0438 Result-\u043e\u0431\u0432\u044f\u0437\u043a\u043e\u0439 \u043e\u0448\u0438\u0431\u043e\u043a \u2014 \u0438 \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u0438, \u043a\u0430\u043a \u0442\u043e\u0442 \u0436\u0435 <code>signUp<\/code> \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0432 \u043d\u0435\u0439.<\/p>\n<p>\u0427\u0430\u0441\u0442\u044c 5 \u2014 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u0430\u044f \u0432\u0441\u0435\u043b\u0435\u043d\u043d\u0430\u044f \u0442\u043e\u0433\u043e \u0436\u0435 \u0441\u044e\u0436\u0435\u0442\u0430. \u0422\u0435 \u0436\u0435 \u0431\u0438\u0437\u043d\u0435\u0441-\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f, \u0447\u0442\u043e \u043f\u0440\u0438\u043b\u0435\u0442\u0435\u043b\u0438 \u0432 feature-based \u0432 \u0447\u0430\u0441\u0442\u044f\u0445 1\u20132, \u0442\u0435\u043f\u0435\u0440\u044c \u043f\u0440\u0438\u043b\u0435\u0442\u0430\u044e\u0442 \u0432 FBCA-\u043a\u043e\u0434\u043e\u0432\u0443\u044e \u0431\u0430\u0437\u0443 \u0438\u0437 \u0447\u0430\u0441\u0442\u0438 4: handler \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u043e\u0431\u0440\u0430\u0441\u0442\u0430\u0435\u0442 \u0442\u0435\u043c\u0438 \u0436\u0435 \u0432\u043d\u0435\u0448\u043d\u0438\u043c\u0438 \u0441\u0435\u0440\u0432\u0438\u0441\u0430\u043c\u0438 (\u0430\u043d\u0442\u0438-\u0444\u0440\u043e\u0434, \u0440\u0435\u0444\u0435\u0440\u0430\u043b\u043a\u0438, \u043f\u0430\u0440\u0442\u043d\u0451\u0440\u044b, \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u043a\u0430), \u043c\u043e\u0434\u0443\u043b\u044c <code>Users<\/code> \u2014 \u0442\u0435\u043c\u0438 \u0436\u0435 \u0444\u0438\u0447\u0430\u043c\u0438 (\u043f\u0440\u043e\u0444\u0438\u043b\u044c, \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438, \u043f\u0440\u0438\u0432\u0430\u0442\u043d\u043e\u0441\u0442\u044c, \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0430). \u0421\u043c\u043e\u0442\u0440\u0438\u043c, \u0447\u0442\u043e \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043f\u043e \u0444\u043e\u0440\u043c\u0435, \u0447\u0442\u043e \u2014 \u043f\u043e \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u044e, \u0438 \u043f\u043e\u0447\u0435\u043c\u0443 \u0433\u0440\u0430\u0444 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u043e\u0441\u0442\u0430\u0451\u0442\u0441\u044f \u0430\u0446\u0438\u043a\u043b\u0438\u0447\u043d\u044b\u043c \u0434\u0430\u0436\u0435 \u043f\u043e\u0441\u043b\u0435 \u043c\u043d\u043e\u0433\u043e\u043a\u0440\u0430\u0442\u043d\u043e\u0433\u043e \u0440\u043e\u0441\u0442\u0430. \u0412 \u043a\u043e\u043d\u0446\u0435 \u2014 \u0444\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u043e\u0431\u043e\u0441\u043d\u043e\u0432\u0430\u043d\u0438\u0435 \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 \u0442\u0435\u043e\u0440\u0438\u0438 \u0433\u0440\u0430\u0444\u043e\u0432: \u043f\u043e\u0447\u0435\u043c\u0443 DAG-\u0438\u043d\u0432\u0430\u0440\u0438\u0430\u043d\u0442, \u0433\u0440\u0430\u043d\u0438\u0446\u0430 \u0441\u0432\u044f\u0437\u043d\u043e\u0441\u0442\u0438 \u0438 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u043d\u0430\u044f \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u044c \u0438\u043d\u043a\u0440\u0435\u043c\u0435\u043d\u0442\u0430 \u2014 \u044d\u0442\u043e \u043d\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b \u0432 \u0441\u043c\u044b\u0441\u043b\u0435 \u00ab\u0443\u0434\u043e\u0431\u043d\u043e\u00bb, \u0430 \u0435\u0451 \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u0435.<\/p>\n<p>\u041f\u043e\u043c\u043d\u0438\u0442\u0435 \u043d\u0430\u0431\u043e\u0440 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u0439 \u0438\u0437 \u0447\u0430\u0441\u0442\u0438 2 \u2014 \u0442\u043e\u0442, \u043f\u043e\u0434 \u0432\u0435\u0441\u043e\u043c \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e <code>AuthService.signUp<\/code> \u043f\u0440\u0435\u0432\u0440\u0430\u0442\u0438\u043b\u0441\u044f \u0432 god-\u0441\u0435\u0440\u0432\u0438\u0441 \u043d\u0430 \u0432\u043e\u0441\u0435\u043c\u044c\u0441\u043e\u0442 \u0441\u0442\u0440\u043e\u043a, \u043e\u0431\u0440\u043e\u0441\u0448\u0438\u0439 \u0448\u0435\u0441\u0442\u044c\u044e \u0441\u043e\u0441\u0435\u0434\u043d\u0438\u043c\u0438 \u0441\u0435\u0440\u0432\u0438\u0441\u0430\u043c\u0438 \u0438 \u043e\u0434\u043d\u0438\u043c \u043e\u0431\u0440\u0430\u0442\u043d\u044b\u043c <code>forwardRef<\/code>\u2019\u043e\u043c? \u0422\u043e\u0442 \u0436\u0435 \u0441\u0430\u043c\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a \u0441\u0435\u0439\u0447\u0430\u0441 \u043f\u0440\u0438\u043b\u0435\u0442\u0430\u0435\u0442 \u0432 FBCA-\u043a\u043e\u0434\u043e\u0432\u0443\u044e \u0431\u0430\u0437\u0443:<\/p>\n<ul>\n<li>\n<p>\u043f\u0430\u0440\u0442\u043d\u0451\u0440\u0441\u043a\u0430\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0441 \u0431\u043b\u043e\u0433\u0435\u0440\u0430\u043c\u0438 \u0438 \u0441\u0442\u0440\u0438\u043c\u0435\u0440\u0430\u043c\u0438<\/p>\n<\/li>\n<li>\n<p>\u0440\u0430\u0437\u043d\u044b\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 \u043c\u043e\u043d\u0435\u0442\u0438\u0437\u0430\u0446\u0438\u0438 (revenue share, \u0431\u043e\u043d\u0443\u0441\u044b, \u0443\u0440\u043e\u0432\u043d\u0438)<\/p>\n<\/li>\n<li>\n<p>\u0431\u043e\u043b\u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u044b\u0439 \u0430\u043d\u0442\u0438-\u0444\u0440\u043e\u0434 (\u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0435\u0432 \u0438 \u0441\u043a\u043e\u0440\u0438\u043d\u0433)<\/p>\n<\/li>\n<li>\n<p>\u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u043d\u0430\u044f \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u043a\u0430 (\u043c\u0430\u0440\u043a\u0435\u0442\u0438\u043d\u0433, \u043f\u0440\u043e\u0434\u0443\u043a\u0442, \u0444\u0438\u043d\u0430\u043d\u0441\u044b)<\/p>\n<\/li>\n<li>\n<p>\u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0438 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u0440\u0435\u0444\u0435\u0440\u0430\u043b\u043e\u043a<\/p>\n<\/li>\n<\/ul>\n<p>\u0411\u0438\u0437\u043d\u0435\u0441-\u043b\u043e\u0433\u0438\u043a\u0430 \u043e\u0431\u044f\u0437\u0430\u043d\u0430 \u043e\u0441\u0442\u0430\u0442\u044c\u0441\u044f \u0442\u043e\u0439 \u0436\u0435 \u2014 \u0438\u043d\u0430\u0447\u0435 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u043d\u0435\u0447\u0435\u0441\u0442\u043d\u043e\u0435. \u0410 \u0432\u043e\u0442 \u0444\u043e\u0440\u043c\u0430 \u043a\u043e\u0434\u0430 \u0438 \u0433\u0440\u0430\u0444\u0430 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u2014 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a \u043e\u043d\u0438 \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u0441\u044f. \u041e\u0433\u043e\u0432\u043e\u0440\u043a\u0430 \u043f\u0440\u043e \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0438 \u0438\u0437 \u0447\u0430\u0441\u0442\u0438 1 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u0442 \u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0437\u0434\u0435\u0441\u044c \u0438 \u0434\u0430\u043b\u0435\u0435 \u2014 \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u043c \u0434\u0435\u043a\u043e\u043c\u043f\u043e\u0437\u0438\u0446\u0438\u044e, \u0430 \u043d\u0435 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u043e\u043d\u043d\u0443\u044e \u0446\u0435\u043b\u043e\u0441\u0442\u043d\u043e\u0441\u0442\u044c.<\/p>\n<pre><code class=\"typescript\">export type SignUpInput = {  email: string;  password: string;  referralCode?: string;  adSourceCode?: string;  ip?: string;  deviceId?: string;};@Injectable()export class SignUpHandler {  constructor(    private readonly bonusExternalService: BonusExternalService,    private readonly usersExternalService: UsersExternalService,    private readonly partnerExternalService: PartnerExternalService,    private readonly adSourceExternalService: AdSourceExternalService,    private readonly referralExternalService: ReferralExternalService,    private readonly analyticsExternalService: AnalyticsExternalService,    private readonly antiFraudExternalService: AntiFraudExternalService,  ) {}  async run(    input: SignUpInput,  ): Promise&lt;Result&lt;SignUpResult, SignUpErrorCode&gt;&gt; {    const { email, password, referralCode, adSourceCode, ip, deviceId } = input;    \/\/ \u0430\u043d\u0442\u0438-\u0444\u0440\u043e\u0434    const checkAntiFraudResult =      await this.antiFraudExternalService.checkSignUp({ ip, deviceId });    if (checkAntiFraudResult.isErr()) {      return err(\"SIGN_UP_ANTI_FRAUD_FAILED\");    }    if (!checkAntiFraudResult.value.allowed) {      return err(\"SIGN_UP_ANTI_FRAUD_REJECTED\");    }    \/\/ \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c, \u0447\u0442\u043e \u044e\u0437\u0435\u0440 \u0435\u0449\u0451 \u043d\u0435 \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d \u2014 \u0434\u043e \u043b\u044e\u0431\u044b\u0445 side-effect'\u043e\u0432    const findUserResult =      await this.usersExternalService.getUserByEmail(email);    if (findUserResult.isErr()) {      return err(\"SIGN_UP_GET_USER_FAILED\");    }    if (findUserResult.value) {      return err(\"SIGN_UP_USER_ALREADY_EXISTS\");    }    \/\/ \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a \u0442\u0440\u0430\u0444\u0438\u043a\u0430 \/ A\/B    const applyAdSourceResult =      await this.adSourceExternalService.applyAdSource(adSourceCode);    if (applyAdSourceResult.isErr()) {      return err(\"SIGN_UP_AD_SOURCE_FAILED\");    }    \/\/ \u0440\u0435\u0444\u0435\u0440\u0430\u043b \/ \u043f\u0430\u0440\u0442\u043d\u0451\u0440 (\u043c\u043e\u0434\u0443\u043b\u044c \u0441\u0430\u043c \u0440\u0435\u0448\u0430\u0435\u0442, \u0447\u0442\u043e \u044d\u0442\u043e \u0437\u0430 \u043a\u043e\u0434)    const resolveReferralResult = await this.referralExternalService.resolve(      referralCode,      email,    );    if (resolveReferralResult.isErr()) {      return err(\"SIGN_UP_REFERRAL_RESOLVE_FAILED\");    }    const createUserResult = await this.usersExternalService.createUser({      email,      password,      adSource: applyAdSourceResult.value,      ip,      deviceId,    });    if (createUserResult.isErr()) {      return err(\"SIGN_UP_CREATE_USER_FAILED\");    }    const referral = resolveReferralResult.value;    const user = createUserResult.value;    \/\/ \u0431\u043e\u043d\u0443\u0441\u044b    if (referral?.kind === \"user\") {      const giveReferralBonusResult =        await this.bonusExternalService.giveReferralBonus(referral.ownerId);      if (giveReferralBonusResult.isErr()) {        return err(\"SIGN_UP_BONUS_FAILED\");      }      const createReferralResult =        await this.referralExternalService.createReferral(          referral.ownerId,          user.id,        );      if (createReferralResult.isErr()) {        return err(\"SIGN_UP_REFERRAL_CREATE_FAILED\");      }    }    if (referral?.kind === \"partner\") {      const processPartnerResult =        await this.partnerExternalService.processPartner(referral);      if (processPartnerResult.isErr()) {        return err(\"SIGN_UP_PARTNER_FAILED\");      }      const givePartnerRewardResult =        await this.bonusExternalService.givePartnerReward(          processPartnerResult.value,        );      if (givePartnerRewardResult.isErr()) {        return err(\"SIGN_UP_PARTNER_REWARD_FAILED\");      }      const trackPartnerRewardResult =        await this.analyticsExternalService.trackPartnerReward(          processPartnerResult.value,        );      if (trackPartnerRewardResult.isErr()) {        return err(\"SIGN_UP_ANALYTICS_FAILED\");      }    }    \/\/ \u0444\u0438\u043d\u0430\u043b\u044c\u043d\u0430\u044f \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u043a\u0430    const trackRegistrationResult =      await this.analyticsExternalService.trackRegistration({        userId: user.id,        source: applyAdSourceResult.value?.code,        ip,      });    if (trackRegistrationResult.isErr()) {      return err(\"SIGN_UP_ANALYTICS_FAILED\");    }    return ok({ id: user.id, email: user.email });  }}<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:87px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u041a\u0430\u043a \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043d\u0430\u0431\u043b\u044e\u0434\u0430\u0442\u044c, \u043b\u043e\u0433\u0438\u043a\u0430, \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0438 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u044b \u043e\u0441\u0442\u0430\u043b\u0438\u0441\u044c \u0442\u043e\u0447\u043d\u043e \u0442\u0430\u043a\u0438\u043c\u0438 \u0436\u0435. \u0422\u043e\u0433\u0434\u0430 \u0443 \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u044f \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u044e\u0442 \u043b\u043e\u0433\u0438\u0447\u043d\u044b\u0435 \u0432\u043e\u043f\u0440\u043e\u0441\u044b:<\/p>\n<ol>\n<li>\n<p>\u0417\u0430\u0447\u0435\u043c \u043c\u044b \u0432\u043e\u043e\u0431\u0449\u0435 \u0432\u043d\u0435\u0434\u0440\u044f\u043b\u0438 <code>feature-based-clean<\/code>, \u0435\u0441\u043b\u0438 \u0431\u0438\u0437\u043d\u0435\u0441-\u043b\u043e\u0433\u0438\u043a\u0430 \u0438\u0434\u0435\u043d\u0442\u0438\u0447\u043d\u0430 FB-\u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0443?<\/p>\n<\/li>\n<li>\n<p>\u041a\u043e\u0434\u0430 \u0441\u0442\u0430\u043b\u043e \u0431\u043e\u043b\u044c\u0448\u0435, \u043d\u0435 \u043c\u0435\u043d\u044c\u0448\u0435. \u0413\u0434\u0435 \u043e\u0431\u0435\u0449\u0430\u043d\u043d\u0430\u044f \u0447\u0438\u0442\u0430\u0431\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c?<\/p>\n<\/li>\n<li>\n<p>\u0427\u0442\u043e \u044f \u043a\u0430\u043a \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0432\u044b\u0438\u0433\u0440\u044b\u0432\u0430\u044e \u043f\u0440\u044f\u043c\u043e \u0441\u0435\u0439\u0447\u0430\u0441, \u0435\u0441\u043b\u0438 \u0438\u0442\u043e\u0433 \u2014 \u0442\u0435 \u0436\u0435 \u0441\u0430\u043c\u044b\u0435 \u0448\u0430\u0433\u0438, \u0442\u043e\u043b\u044c\u043a\u043e \u0441 \u0431\u043e\u043b\u044c\u0448\u0438\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e\u043c \u043f\u0430\u043f\u043e\u043a \u0438 \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0446\u0438\u0439?<\/p>\n<\/li>\n<\/ol>\n<p>\u042d\u0442\u0438 \u0432\u043e\u043f\u0440\u043e\u0441\u044b \u0432\u044b\u0433\u043b\u044f\u0434\u044f\u0442 \u043a\u0430\u043a \u043e\u043f\u0440\u043e\u0432\u0435\u0440\u0436\u0435\u043d\u0438\u0435 \u0432\u0441\u0435\u0439 \u0438\u0434\u0435\u0438. \u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u043e\u043d\u0438 \u043f\u043e\u0434\u0441\u0432\u0435\u0447\u0438\u0432\u0430\u044e\u0442 \u0442\u043e, \u0447\u0442\u043e \u043c\u044b \u0443\u0436\u0435 \u0437\u0430\u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043b\u0438 \u0432 \u0444\u0438\u043d\u0430\u043b\u0435 \u0447\u0430\u0441\u0442\u0438 4: FBCA \u2014 \u044d\u0442\u043e \u043d\u0435 \u043f\u0440\u043e \u0441\u0435\u0433\u043e\u0434\u043d\u044f\u0448\u043d\u0438\u0439 \u043a\u043e\u0434, \u0430 \u043f\u0440\u043e \u043a\u043e\u0434 \u0447\u0435\u0440\u0435\u0437 \u0441\u043f\u0440\u0438\u043d\u0442-\u0434\u0432\u0430-\u0442\u0440\u0438. \u0415\u0441\u043b\u0438 \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u0441\u043d\u0438\u043c\u043e\u043a, FB \u0438 FBCA \u0432\u044b\u0433\u043b\u044f\u0434\u044f\u0442 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u043e \u2014 \u0440\u0430\u0437\u043d\u0438\u0446\u0430 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0443 \u043e\u0434\u043d\u043e\u0433\u043e \u0435\u0441\u0442\u044c \u0442\u043e\u0447\u043a\u0438, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043c\u043e\u0436\u043d\u043e \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c\u0441\u044f, \u0430 \u0443 \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u043d\u0435\u0442. \u042d\u0442\u0430 \u0440\u0430\u0437\u043d\u0438\u0446\u0430 \u043d\u0435 \u0432\u0438\u0434\u043d\u0430, \u043f\u043e\u043a\u0430 \u043d\u0435 \u043f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u043d\u0430\u044f \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0430. \u0418 \u0438\u043c\u0435\u043d\u043d\u043e \u0435\u0451 \u043c\u044b \u0441\u0435\u0439\u0447\u0430\u0441 \u0443\u0432\u0438\u0434\u0438\u043c \u0432 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0438.<\/p>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043a\u0430\u043a \u0441 \u0442\u0435\u0447\u0435\u043d\u0438\u0435\u043c \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0440\u0430\u0437\u0432\u0438\u0432\u0430\u043b\u0441\u044f \u043c\u043e\u0434\u0443\u043b\u044c <code>Users<\/code> \u043f\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u0430\u043c <code>feature-based-clean<\/code>. \u041f\u043e\u043a\u0430 handler \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u044f \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u043e\u0431\u0440\u0430\u0441\u0442\u0430\u043b \u0432\u043d\u0435\u0448\u043d\u0438\u043c\u0438 \u0441\u0435\u0440\u0432\u0438\u0441\u0430\u043c\u0438, \u0441\u0430\u043c \u043c\u043e\u0434\u0443\u043b\u044c <code>Users<\/code> \u0442\u043e\u0436\u0435 \u0440\u0430\u0437\u0432\u0438\u0432\u0430\u043b\u0441\u044f \u2014 \u0444\u0440\u043e\u043d\u0442 \u043f\u0440\u043e\u0441\u0438\u043b \u043f\u0440\u043e\u0444\u0438\u043b\u044c, \u043c\u0430\u0440\u043a\u0435\u0442\u0438\u043d\u0433 \u2014 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0443, \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u043a\u0430 \u2014 \u0441\u0447\u0451\u0442\u0447\u0438\u043a\u0438. \u041a \u0442\u0435\u043a\u0443\u0449\u0435\u043c\u0443 \u043c\u043e\u043c\u0435\u043d\u0442\u0443 \u0443 <code>Users<\/code> \u0443\u0436\u0435 \u043d\u0435 \u0442\u043e\u0442 \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u0439 \u043c\u043e\u0434\u0443\u043b\u044c \u0441 \u0434\u0432\u0443\u043c\u044f use-case\u2019\u0430\u043c\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u043f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043b\u0438 \u0432 \u0447\u0430\u0441\u0442\u0438 4. \u0422\u0435\u043f\u0435\u0440\u044c \u044d\u0442\u043e \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u044b\u0439 \u0434\u043e\u043c\u0435\u043d:<\/p>\n<ul>\n<li>\n<p>\u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0444\u0438\u043b\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f<\/p>\n<\/li>\n<li>\n<p>\u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0444\u0438\u043b\u044f (bio, avatar, username)<\/p>\n<\/li>\n<li>\n<p>\u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a \u0430\u043a\u043a\u0430\u0443\u043d\u0442\u0430<\/p>\n<\/li>\n<li>\n<p>\u043f\u0440\u0438\u0432\u0430\u0442\u043d\u043e\u0441\u0442\u044c \u0430\u043a\u043a\u0430\u0443\u043d\u0442\u0430 (public \/ private)<\/p>\n<\/li>\n<li>\n<p>\u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0431\u0430\u0437\u043e\u0432\u043e\u0439 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0438 (\u043f\u043e\u0434\u043f\u0438\u0441\u0447\u0438\u043a\u0438, \u043f\u043e\u0434\u043f\u0438\u0441\u043a\u0438)<\/p>\n<\/li>\n<li>\n<p>\u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u043c\u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u043c\u0438 (\u044f\u0437\u044b\u043a, \u0442\u0435\u043c\u0430 \u0438 \u0442. \u0434.)<\/p>\n<\/li>\n<li>\n<p>\u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f (<code>me<\/code> endpoint)<\/p>\n<\/li>\n<\/ul>\n<pre><code class=\"bash\">src\/modules\/users\/\u251c\u2500\u2500 domain\/                           # User, UserProfile, UserSettings, UserPrivacy, ...\u2502\u251c\u2500\u2500 use-case\/\u2502   \u251c\u2500\u2500 presentation\/                 # \u0421\u0446\u0435\u043d\u0430\u0440\u0438\u0438 \u0434\u043b\u044f UsersController\u2502   \u2502   \u251c\u2500\u2500 get-profile\/\u2502   \u2502   \u251c\u2500\u2500 update-profile\/\u2502   \u2502   \u251c\u2500\u2500 update-account-settings\/\u2502   \u2502   \u251c\u2500\u2500 update-privacy\/\u2502   \u2502   \u251c\u2500\u2500 update-preferences\/\u2502   \u2502   \u251c\u2500\u2500 get-user-stats\/\u2502   \u2502   \u2514\u2500\u2500 get-current-user\/\u2502   \u2502\u2502   \u2514\u2500\u2500 external\/                     # \u0421\u0446\u0435\u043d\u0430\u0440\u0438\u0438 \u0434\u043b\u044f \u0434\u0440\u0443\u0433\u0438\u0445 \u043c\u043e\u0434\u0443\u043b\u0435\u0439 (\u0447\u0435\u0440\u0435\u0437 external-\u043f\u043e\u0440\u0442)\u2502       \u251c\u2500\u2500 create-user\/              # \u2190 Auth\u2502       \u251c\u2500\u2500 get-user-by-email\/        # \u2190 Auth\u2502       \u251c\u2500\u2500 check-user-exists\/        # \u2190 Likes, Comments, Follows\u2502       \u251c\u2500\u2500 get-following-ids\/        # \u2190 Feed\u2502       \u251c\u2500\u2500 can-view-content\/         # \u2190 Feed\u2502       \u251c\u2500\u2500 can-receive-notification\/ # \u2190 Notifications\u2502       \u251c\u2500\u2500 get-public-user-info\/     # \u2190 Comments, Likes\u2502       \u251c\u2500\u2500 is-searchable\/            # \u2190 Search\u2502       \u251c\u2500\u2500 is-user-blocked\/          # \u2190 Moderation, AntiFraud\u2502       \u2514\u2500\u2500 get-user-status\/          # \u2190 \u0440\u0430\u0437\u043d\u044b\u0435 \u043c\u043e\u0434\u0443\u043b\u0438\u2502\u251c\u2500\u2500 infrastructure\/\u2502   \u2514\u2500\u2500 repositories\/\u2502       \u251c\u2500\u2500 user\/\u2502       \u251c\u2500\u2500 user-profile\/\u2502       \u251c\u2500\u2500 user-settings\/\u2502       \u251c\u2500\u2500 user-privacy\/\u2502       \u251c\u2500\u2500 user-preferences\/\u2502       \u251c\u2500\u2500 user-stats\/\u2502       \u2514\u2500\u2500 user-session\/\u2502\u251c\u2500\u2500 external\/                         # \u041f\u043e\u0440\u0442 \u0434\u043b\u044f \u0434\u0440\u0443\u0433\u0438\u0445 \u043c\u043e\u0434\u0443\u043b\u0435\u0439 (Auth, Feed, Comments, Search, ...)\u2502\u2514\u2500\u2500 presentation\/                     # UsersController + DTO<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u041a\u0430\u043a \u043c\u044b \u0432\u0438\u0434\u0438\u043c, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u0432 \u0431\u043e\u043b\u044c\u0448\u043e\u043c \u0440\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u043d\u0433\u0435 \u00ab\u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043f\u043e \u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0441\u0442\u0438\u00bb \u043e\u0442\u043f\u0430\u043b\u0430. \u0412 feature-based, \u043a\u043e\u0433\u0434\u0430 <code>UsersService<\/code> \u0434\u043e\u0441\u0442\u0438\u0433\u0430\u0435\u0442 \u043a\u0440\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u043c\u0430\u0441\u0441\u044b \u2014 \u0441\u043a\u0430\u0436\u0435\u043c, \u0432\u043e\u0441\u0435\u043c\u044c\u0441\u043e\u0442 \u0441\u0442\u0440\u043e\u043a \u0438 \u043f\u044f\u0442\u043d\u0430\u0434\u0446\u0430\u0442\u044c \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u043f\u0440\u043e \u0440\u0430\u0437\u043d\u044b\u0435 \u043f\u043e\u0434\u0441\u0438\u0441\u0442\u0435\u043c\u044b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f, \u2014 \u043d\u0430\u0441\u0442\u0443\u043f\u0430\u0435\u0442 \u0432\u0440\u0435\u043c\u044f \u0434\u043b\u044f \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043f\u0435\u0440\u0435\u0434\u0435\u043b\u043a\u0438. \u0420\u0430\u0437\u0434\u0440\u043e\u0431\u0438\u0442\u044c \u043d\u0430 <code>UserProfileService<\/code>, <code>UserSettingsService<\/code>, <code>UserPrivacyService<\/code>. \u042d\u0442\u043e \u0441\u0435\u0440\u044c\u0451\u0437\u043d\u0430\u044f \u0440\u0430\u0431\u043e\u0442\u0430: \u043f\u0435\u0440\u0435\u043f\u0438\u0441\u0430\u0442\u044c \u0432\u044b\u0437\u043e\u0432\u044b, \u0440\u0430\u0437\u0440\u0443\u043b\u0438\u0442\u044c \u0446\u0438\u043a\u043b\u044b, \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u0442\u0435\u0441\u0442\u044b, \u043f\u0435\u0440\u0435\u0441\u043e\u0431\u0440\u0430\u0442\u044c \u043c\u043e\u0434\u0443\u043b\u0438. \u041c\u0435\u0441\u044f\u0446-\u043f\u043e\u043b\u0442\u043e\u0440\u0430 \u043a\u0430\u043a \u043c\u0438\u043d\u0438\u043c\u0443\u043c \u2014 \u0438 \u0432\u0441\u0451 \u044d\u0442\u043e \u0432\u0440\u0435\u043c\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0434\u043e\u043b\u0436\u043d\u0430 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043d\u0430 \u043f\u0440\u043e\u0434\u0435.<\/p>\n<p>\u0412 FBCA \u044d\u0442\u043e\u0439 \u0442\u043e\u0447\u043a\u0438 \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0435\u0442. \u041a\u043e\u0433\u0434\u0430 \u043f\u0440\u043e\u0434\u0430\u043a\u0442 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442 \u0441 \u00ab\u043d\u0443\u0436\u043d\u044b \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043f\u0440\u0438\u0432\u0430\u0442\u043d\u043e\u0441\u0442\u0438\u00bb \u2014 \u044d\u0442\u043e <code>use-case\/presentation\/update-privacy\/<\/code> \u0440\u044f\u0434\u043e\u043c \u0441 \u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u043c\u0438 <code>update-profile\/<\/code> \u0438 <code>update-account-settings\/<\/code>. \u041a\u043e\u0433\u0434\u0430 DBA \u0433\u043e\u0432\u043e\u0440\u0438\u0442 \u00ab\u0445\u043e\u0440\u043e\u0448\u043e \u0431\u044b \u0432\u044b\u043d\u0435\u0441\u0442\u0438 <code>user_sessions<\/code> \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0443\u044e \u0442\u0430\u0431\u043b\u0438\u0446\u0443\u00bb \u2014 \u044d\u0442\u043e <code>infrastructure\/repositories\/user-session\/<\/code> \u0440\u044f\u0434\u043e\u043c \u0441 <code>user\/<\/code> \u0438 <code>user-profile\/<\/code>. \u041a\u0430\u0436\u0434\u044b\u0439 \u043d\u043e\u0432\u044b\u0439 \u0430\u0440\u0442\u0435\u0444\u0430\u043a\u0442 \u043b\u043e\u0436\u0438\u0442\u0441\u044f \u0440\u044f\u0434\u043e\u043c \u0441\u043e \u0441\u0442\u0430\u0440\u044b\u043c\u0438, \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0441\u0434\u0432\u0438\u0433\u0430\u044f. \u041f\u0430\u043f\u043e\u043a \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u0431\u043e\u043b\u044c\u0448\u0435, \u043d\u043e \u044d\u0442\u043e \u043d\u0435 \u0440\u0430\u0437\u0440\u0430\u0441\u0442\u0430\u043d\u0438\u0435 \u2014 \u044d\u0442\u043e \u0433\u043e\u0440\u0438\u0437\u043e\u043d\u0442\u0430\u043b\u044c\u043d\u044b\u0439 \u0440\u043e\u0441\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044f \u0442\u0430\u043a \u0436\u0435, \u043a\u0430\u043a \u043f\u044f\u0442\u044c \u0444\u0430\u0439\u043b\u043e\u0432 \u0447\u0438\u0442\u0430\u043b\u0438\u0441\u044c.<\/p>\n<p>\u0410 \u043a\u043e\u0433\u0434\u0430 use-case\u2019\u043e\u0432 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044c-\u0442\u0440\u0438\u0434\u0446\u0430\u0442\u044c \u0438 \u0432 \u043e\u0434\u043d\u043e\u0439 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u0433\u043b\u0430\u0437\u0430 \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0442 \u0440\u0430\u0437\u0431\u0435\u0433\u0430\u0442\u044c\u0441\u044f, \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u00ab\u043f\u043e \u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0441\u0442\u0438\u00bb \u0441\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043a \u043e\u0434\u043d\u043e\u0439 \u043c\u0435\u0445\u0430\u043d\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438: \u0440\u0430\u0437\u043b\u043e\u0436\u0438\u0442\u044c \u0433\u043e\u0442\u043e\u0432\u044b\u0435 \u043a\u0443\u0441\u043e\u0447\u043a\u0438 \u043b\u0435\u0433\u043e \u043f\u043e \u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u043f\u0430\u043f\u043a\u0430\u043c. <code>update-profile\/<\/code>, <code>update-bio\/<\/code>, <code>update-avatar\/<\/code> \u0443\u0435\u0437\u0436\u0430\u044e\u0442 \u0432 <code>use-case\/presentation\/profile\/<\/code>. <code>update-privacy\/<\/code>, <code>update-account-settings\/<\/code> \u2014 \u0432 <code>use-case\/presentation\/security\/<\/code>. \u041d\u0438\u043a\u0430\u043a\u0438\u0445 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u0440\u0430\u0437\u0440\u0443\u043b\u0438\u0432\u0430\u0442\u044c \u043d\u0435 \u043d\u0430\u0434\u043e, \u043d\u0438\u043a\u0430\u043a\u0438\u0445 \u0446\u0438\u043a\u043b\u043e\u0432, \u043d\u0438\u043a\u0430\u043a\u043e\u0439 Nest DI-\u043f\u0435\u0440\u0435\u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438. PR \u043c\u043e\u0436\u0435\u0442 \u043e\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f \u0436\u0438\u0440\u043d\u044b\u043c \u2014 \u043d\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u0438\u0437-\u0437\u0430 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u043c\u0435\u043d\u044f\u044e\u0442\u0441\u044f \u043f\u0443\u0442\u0438 \u0438\u043c\u043f\u043e\u0440\u0442\u043e\u0432; \u043d\u0438 \u043e\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u0447\u043a\u0438 \u043b\u043e\u0433\u0438\u043a\u0438 \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0432\u044b \u043d\u0435 \u043f\u0440\u0430\u0432\u0438\u0442\u0435.<\/p>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0442\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u0433\u0440\u0430\u0444 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043b\u0441\u044f \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 <code>FBCA<\/code>.<\/p>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/\/post_images\/f39\/be9\/83b\/f39be983b3ce8b54e6a9fb549cec9b55.svg\" alt=\"\u0413\u0440\u0430\u0444 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 FBCA: \u043c\u043e\u0434\u0443\u043b\u0438 Auth \u0438 Users\" sizes=\"(max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/\/post_images\/f39\/be9\/83b\/f39be983b3ce8b54e6a9fb549cec9b55.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/\/post_images\/f39\/be9\/83b\/f39be983b3ce8b54e6a9fb549cec9b55.svg 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<div><figcaption>\u0413\u0440\u0430\u0444 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 FBCA: \u043c\u043e\u0434\u0443\u043b\u0438 Auth \u0438 Users<\/figcaption><\/div>\n<\/figure>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u0441\u043c\u043e\u0442\u043e\u0440\u0438\u043c \u043d\u0430 \u0433\u0440\u0430\u0444 <code>FB<\/code> \u0434\u043e \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u0442\u0430\u043c \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0442\u0441\u044f \u0446\u0438\u043a\u043b\u044b.<\/p>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/\/post_images\/f63\/920\/e91\/f63920e91c523b46b1920f083c25bd76.svg\" alt=\"\u0413\u0440\u0430\u0444 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 FBCA: \u043c\u043e\u0434\u0443\u043b\u0438 Auth \u0438 Users\" sizes=\"(max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/\/post_images\/f63\/920\/e91\/f63920e91c523b46b1920f083c25bd76.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/\/post_images\/f63\/920\/e91\/f63920e91c523b46b1920f083c25bd76.svg 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<div><figcaption>\u0413\u0440\u0430\u0444 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 FBCA: \u043c\u043e\u0434\u0443\u043b\u0438 Auth \u0438 Users<\/figcaption><\/div>\n<\/figure>\n<p>\u0420\u0430\u0437\u0443\u043c\u0435\u0435\u0442\u0441\u044f, <code>FB<\/code> \u0437\u0434\u0435\u0441\u044c \u043f\u0440\u043e\u0438\u0433\u0440\u044b\u0432\u0430\u0435\u0442: \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0441\u043e\u0441\u0435\u0434\u043d\u0438\u0445 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 \u043d\u0430\u0447\u0430\u043b\u0438 \u0442\u044f\u043d\u0443\u0442\u044c \u043a\u043e\u0434 \u0438\u0437 <code>UsersService<\/code>, \u0438 \u043a\u0430\u0436\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u0443\u0431\u0440\u0430\u0442\u044c \u044d\u0442\u0443 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c, \u0432\u0441\u0451 \u0431\u0443\u0434\u0435\u0442 \u0445\u043e\u0440\u043e\u0448\u043e.<\/p>\n<p>\u042d\u0442\u043e \u0441\u0430\u043c\u043e\u043e\u0431\u043c\u0430\u043d. \u0421\u0442\u0440\u0435\u043b\u043a\u0438 \u2014 \u043d\u0435 \u043b\u0435\u043d\u0438\u0432\u0430\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430, \u0430 \u043e\u0442\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0431\u0438\u0437\u043d\u0435\u0441\u0430: \u0440\u0435\u0444\u0435\u0440\u0430\u043b\u044c\u043d\u0430\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u043f\u0440\u0430\u0432\u0434\u0430 \u0434\u043e\u043b\u0436\u043d\u0430 \u0437\u043d\u0430\u0442\u044c, \u043a\u0442\u043e \u043a\u043e\u0433\u043e \u043f\u0440\u0438\u0433\u043b\u0430\u0441\u0438\u043b; \u0430\u043d\u0442\u0438-\u0444\u0440\u043e\u0434 \u2014 \u0432\u0438\u0434\u0435\u0442\u044c \u0438\u0441\u0442\u043e\u0440\u0438\u044e \u0430\u043a\u043a\u0430\u0443\u043d\u0442\u0430; \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u043a\u0430 \u2014 \u043e\u0431\u043e\u0433\u0430\u0449\u0430\u0442\u044c \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u043f\u0440\u043e\u0444\u0438\u043b\u0435\u043c. \u0423\u0431\u0440\u0430\u0442\u044c \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043d\u0435\u043b\u044c\u0437\u044f \u2014 \u043c\u043e\u0434\u0443\u043b\u0438 \u043f\u0435\u0440\u0435\u0441\u0442\u0430\u043d\u0443\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c.<\/p>\n<p>\u0422\u0435 \u0436\u0435 \u043f\u043e\u0442\u0440\u0435\u0431\u043d\u043e\u0441\u0442\u0438 \u0435\u0441\u0442\u044c \u0438 \u0432 <code>FBCA<\/code> \u2014 \u0432\u044b\u0448\u0435 \u0441\u0442\u043e\u043b\u044c\u043a\u043e \u0436\u0435 \u0441\u0442\u0440\u0435\u043b\u043e\u043a, \u043d\u043e \u043e\u043d\u0438 \u0432\u0435\u0434\u0443\u0442 \u0432 <code>UsersExternalService<\/code>. \u0420\u0430\u0437\u043d\u0438\u0446\u0430 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043a\u0430\u0436\u0434\u0430\u044f \u0442\u0430\u043a\u0430\u044f \u0441\u0442\u0440\u0435\u043b\u043a\u0430 \u2014 \u044d\u0442\u043e \u043d\u0435 \u00ab\u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u044b\u0439 \u043a\u043b\u044e\u0447 \u043a\u043e \u0432\u0441\u0435\u043c\u0443 <code>Users<\/code>\u00bb, \u0430 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0435 \u043f\u043e\u043b\u043d\u043e\u043c\u043e\u0447\u0438\u0435: \u043e\u0434\u043d\u043e\u043c\u0443 \u0441\u043e\u0441\u0435\u0434\u0443 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u043e \u0437\u0432\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e <code>getUserByEmail<\/code>, \u0434\u0440\u0443\u0433\u043e\u043c\u0443 \u2014 \u0442\u043e\u043b\u044c\u043a\u043e <code>isUserBlocked<\/code>. \u0412 <code>FB<\/code> \u043b\u044e\u0431\u043e\u0439, \u0443 \u043a\u043e\u0433\u043e \u0435\u0441\u0442\u044c <code>UsersService<\/code> \u0432 DI-\u0433\u0440\u0430\u0444\u0435, \u0438\u043c\u0435\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u043f\u043e\u043b\u043d\u043e\u043c\u0443 API \u0445\u0430\u0431\u0430, \u0438 \u0437\u0430\u0432\u0442\u0440\u0430 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u0437\u0432\u0430\u0442\u044c \u043e\u0442\u0442\u0443\u0434\u0430 \u043c\u0435\u0442\u043e\u0434, \u043e \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043d\u0438\u043a\u0442\u043e \u043d\u0435 \u0434\u043e\u0433\u043e\u0432\u0430\u0440\u0438\u0432\u0430\u043b\u0441\u044f. \u0412 <code>FBCA<\/code> \u044d\u0442\u043e \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u043e\u0435 \u043d\u0430\u0440\u0443\u0448\u0435\u043d\u0438\u0435 \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u0430: \u0447\u0435\u0433\u043e \u043d\u0435\u0442 \u0432 <code>external\/<\/code>, \u0442\u043e\u0433\u043e \u0434\u043b\u044f \u0441\u043e\u0441\u0435\u0434\u0430 \u043d\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442.<\/p>\n<p>\u0414\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u0432\u044b \u0443\u0431\u0435\u0440\u0451\u0442\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0445 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 \u043e\u0442 <code>UsersService<\/code>, \u0437\u0430\u0432\u0435\u0434\u0451\u0442\u0435 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438 \u043f\u043e\u0434 \u043a\u0430\u0436\u0434\u0443\u044e \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u044c \u0438 \u043d\u0430\u043b\u0430\u0434\u0438\u0442\u0435 \u0434\u0438\u0441\u0446\u0438\u043f\u043b\u0438\u043d\u0443 \u00ab\u0441\u0435\u0440\u0432\u0438\u0441 \u043d\u0435 \u0437\u043e\u0432\u0451\u0442 \u0441\u0435\u0440\u0432\u0438\u0441\u00bb \u2014 \u044d\u0442\u043e \u043d\u0435 \u0441\u043f\u0430\u0441\u0451\u0442 \u043d\u0430\u0434\u043e\u043b\u0433\u043e.<\/p>\n<p>\u0414\u0435\u043b\u043e \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e <strong>\u0441\u0435\u0440\u0432\u0438\u0441<\/strong> \u043a\u0430\u043a \u0435\u0434\u0438\u043d\u0438\u0446\u0430 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u043a\u043e\u0434\u0430 \u0443\u0441\u0442\u0440\u043e\u0435\u043d \u0442\u0430\u043a, \u0447\u0442\u043e \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u043d\u0435 \u0440\u0430\u0437\u0440\u0430\u0441\u0442\u0430\u0442\u044c\u0441\u044f. \u041e\u0434\u0438\u043d \u043a\u043b\u0430\u0441\u0441 \u2014 \u043c\u043d\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u043e\u0432. \u0421\u0435\u0433\u043e\u0434\u043d\u044f <code>UserProfileService.updateBio()<\/code> \u0438 <code>updateAvatar()<\/code>. \u0417\u0430\u0432\u0442\u0440\u0430 \u0435\u0449\u0451 <code>getProfileMetadata()<\/code>, <code>recalculateCompletenessScore()<\/code>, <code>markAsViewed()<\/code>. \u0427\u0435\u0440\u0435\u0437 \u0441\u043f\u0440\u0438\u043d\u0442 \u0432 \u043d\u0451\u043c \u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044c \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432, \u0438 \u043b\u044e\u0431\u043e\u0439 \u0438\u043c\u043f\u043e\u0440\u0442\u0451\u0440 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f \u043a\u043e \u0432\u0441\u0435\u043c \u0441\u0440\u0430\u0437\u0443. \u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u043d\u0435 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e Profile \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 Users \u2014 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c \u043d\u0430 \u043a\u043b\u0430\u0441\u0441 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0434\u0430\u0451\u0442 \u0434\u043e\u0441\u0442\u0443\u043f \u043a\u043e \u0432\u0441\u0435\u043c\u0443 \u043a\u043b\u0430\u0441\u0441\u0443.<\/p>\n<p>\u0412\u043e\u0442 \u0442\u0443\u0442 \u0438 \u043f\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f use-case \u0432 FBCA-\u0441\u043c\u044b\u0441\u043b\u0435 \u2014 \u0438 \u044d\u0442\u043e <strong>\u043d\u0435<\/strong> \u00ab\u0431\u0438\u0437\u043d\u0435\u0441\u043e\u0432\u044b\u0439 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0439\u00bb \u0432 \u043f\u0440\u0438\u0432\u044b\u0447\u043d\u043e\u043c \u0441\u043c\u044b\u0441\u043b\u0435 \u0441\u043b\u043e\u0432\u0430. Use-case \u0437\u0434\u0435\u0441\u044c \u2014 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043d\u0430\u044f \u0435\u0434\u0438\u043d\u0438\u0446\u0430: \u043e\u0434\u043d\u0430 \u043f\u0430\u043f\u043a\u0430, \u043e\u0434\u0438\u043d handler, \u043e\u0434\u043d\u0430 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f. <code>update-profile\/<\/code> \u2014 \u044d\u0442\u043e \u043d\u0435 \u00ab\u0432\u0441\u044f \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 \u043f\u0440\u043e\u0444\u0438\u043b\u0435\u043c\u00bb, \u044d\u0442\u043e \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e \u00ab\u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c bio\/avatar\/username\u00bb. \u0427\u0442\u043e\u0431\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u00ab\u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u0440\u043e\u0444\u0438\u043b\u044f\u00bb, \u043d\u0443\u0436\u043d\u0430 \u043d\u043e\u0432\u0430\u044f \u043f\u0430\u043f\u043a\u0430 <code>get-profile-metadata\/<\/code> \u0440\u044f\u0434\u043e\u043c, \u0430 \u043d\u0435 \u043d\u043e\u0432\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 \u0432 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u043c handler\u2019\u0435. \u0421\u0430\u043c\u0430 \u0444\u043e\u0440\u043c\u0430 \u043d\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f\u043c \u043d\u0430\u043a\u0430\u043f\u043b\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0432 \u043e\u0434\u043d\u0443 \u0442\u043e\u0447\u043a\u0443.<\/p>\n<p>\u042d\u0442\u043e \u0438 \u0441\u043d\u0438\u043c\u0430\u0435\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443. \u041a\u043e\u0433\u0434\u0430 \u0438\u043c\u043f\u043e\u0440\u0442\u0451\u0440\u0443 \u043d\u0443\u0436\u043d\u0430 \u043e\u0434\u043d\u0430 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f, \u043e\u043d \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u0442 \u0440\u043e\u0432\u043d\u043e \u0435\u0451 \u2014 \u0430 \u043d\u0435 \u0432\u0435\u0441\u044c \u0441\u0435\u0440\u0432\u0438\u0441. \u041a\u043e\u0433\u0434\u0430 \u043f\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u043e\u0432\u0430\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f, \u043e\u043d\u0430 \u043b\u0435\u0436\u0438\u0442 \u0440\u044f\u0434\u043e\u043c, \u043d\u0435 \u0441\u0434\u0432\u0438\u0433\u0430\u044f \u0441\u0442\u0430\u0440\u0443\u044e. \u0413\u0440\u0430\u0444 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u043f\u0435\u0440\u0435\u0441\u0442\u0430\u0451\u0442 \u0441\u0442\u044f\u0433\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u043a \u0445\u0430\u0431\u0430\u043c, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0445\u0430\u0431\u0430\u043c \u043d\u0435\u043a\u0443\u0434\u0430 \u0441\u0442\u044f\u0433\u0438\u0432\u0430\u0442\u044c\u0441\u044f: \u043a\u0430\u0436\u0434\u044b\u0439 \u0443\u0437\u0435\u043b \u2014 \u0430\u0442\u043e\u043c\u0430\u0440\u043d\u0430\u044f \u0435\u0434\u0438\u043d\u0438\u0446\u0430.<\/p>\n<p>\u0412 \u0447\u0430\u0441\u0442\u0438 3 \u043c\u044b \u0443\u0436\u0435 \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u043b\u0438, \u043a\u0430\u043a \u0438\u0437 \u043e\u0434\u043d\u043e\u0433\u043e \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0433\u043e \u0438\u043c\u043f\u043e\u0440\u0442\u0430 \u0440\u043e\u0436\u0434\u0430\u0435\u0442\u0441\u044f <code>forwardRef<\/code>. \u041d\u0430 \u0433\u0440\u0430\u0444\u0435 \u044d\u0442\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0432\u043e\u0442 \u0442\u0430\u043a.<\/p>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/\/post_images\/9b9\/7c1\/f35\/9b97c1f3539e9ada2b92fde4a1dd72b1.svg\" alt=\"\u0413\u0440\u0430\u0444 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 FBCA: \u043c\u043e\u0434\u0443\u043b\u0438 Auth \u0438 Users\" sizes=\"(max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/\/post_images\/9b9\/7c1\/f35\/9b97c1f3539e9ada2b92fde4a1dd72b1.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/\/post_images\/9b9\/7c1\/f35\/9b97c1f3539e9ada2b92fde4a1dd72b1.svg 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<div><figcaption>\u0413\u0440\u0430\u0444 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 FBCA: \u043c\u043e\u0434\u0443\u043b\u0438 Auth \u0438 Users<\/figcaption><\/div>\n<\/figure>\n<h4>\u041c\u043e\u0436\u043d\u043e \u043b\u0438 \u044d\u0442\u043e \u0434\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438?<\/h4>\n<p>\u0415\u0441\u043b\u0438 \u043a\u043e\u0440\u043e\u0442\u043a\u043e \u2014 \u0441\u0430\u043c\u043e \u043f\u043e \u0441\u0435\u0431\u0435 \u0443\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u0435 \u00ab\u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430 \u043d\u0435 \u0434\u0435\u0433\u0440\u0430\u0434\u0438\u0440\u0443\u0435\u0442\u00bb \u043d\u0435\u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435. \u0414\u0435\u0433\u0440\u0430\u0434\u0430\u0446\u0438\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u043b\u044e\u0434\u044c\u043c\u0438, \u0438 \u043b\u044e\u0431\u0443\u044e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u043c\u043e\u0436\u043d\u043e \u0441\u043b\u043e\u043c\u0430\u0442\u044c \u0441\u043e\u0437\u043d\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u043c \u0438\u0433\u043d\u043e\u0440\u043e\u043c. \u041d\u043e <strong>\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043d\u044b\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430<\/strong>, \u043f\u0440\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0434\u0435\u0433\u0440\u0430\u0434\u0430\u0446\u0438\u044f \u0437\u0430\u0442\u0440\u0443\u0434\u043d\u0435\u043d\u0430 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0434\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u0444\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e \u043c\u043e\u0436\u043d\u043e. \u0420\u0430\u0437\u0431\u0435\u0440\u0451\u043c \u0442\u0440\u0438 \u0442\u0430\u043a\u0438\u0445 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430.<\/p>\n<h3>1. DAG-\u0438\u043d\u0432\u0430\u0440\u0438\u0430\u043d\u0442<\/h3>\n<p>\u0413\u0440\u0430\u0444 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u0440\u0430\u0437\u0431\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u0434\u0432\u0430 \u0443\u0440\u043e\u0432\u043d\u044f \u2014 <strong>\u0432\u043d\u0443\u0442\u0440\u0438 \u043e\u0434\u043d\u043e\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044f<\/strong> \u0438 <strong>\u043c\u0435\u0436\u0434\u0443 \u043c\u043e\u0434\u0443\u043b\u044f\u043c\u0438<\/strong>. \u0414\u043e\u043a\u0430\u0436\u0435\u043c, \u0447\u0442\u043e \u043e\u0431\u0430 \u0443\u0440\u043e\u0432\u043d\u044f \u2014 DAG.<\/p>\n<p><strong>\u0412\u043d\u0443\u0442\u0440\u0438\u043c\u043e\u0434\u0443\u043b\u044c\u043d\u044b\u0439 \u0433\u0440\u0430\u0444.<\/strong> \u0412\u0432\u0435\u0434\u0451\u043c:<\/p>\n<ul>\n<li>\n<p><code>V_M<\/code> \u2014 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u043c\u043e\u0434\u0443\u043b\u044f <code>M<\/code> (handler\u2019\u044b, \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438, \u0434\u043e\u043c\u0435\u043d\u043d\u044b\u0435 \u0442\u0438\u043f\u044b, \u043f\u0440\u0435\u0437\u0435\u043d\u0442\u0430\u0446\u0438\u044f, external-\u043f\u043e\u0440\u0442)<\/p>\n<\/li>\n<li>\n<p><code>E_M \u2286 V_M \u00d7 V_M<\/code> \u2014 \u0432\u043d\u0443\u0442\u0440\u0438\u043c\u043e\u0434\u0443\u043b\u044c\u043d\u044b\u0435 \u0440\u0451\u0431\u0440\u0430 \u00ab\u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442\u00bb<\/p>\n<\/li>\n<li>\n<p><code>L: V_M \u2192 \u2115<\/code> \u2014 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0441\u043b\u043e\u044f \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u043e\u0434\u043d\u043e\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044f: <code>domain = 0<\/code>, <code>infrastructure = 1<\/code>, <code>use-case = 2<\/code>, <code>external = 3<\/code>, <code>presentation = 4<\/code><\/p>\n<\/li>\n<\/ul>\n<p><strong>\u0423\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u0435.<\/strong> \u0415\u0441\u043b\u0438 \u0434\u043b\u044f \u043b\u044e\u0431\u043e\u0433\u043e \u0440\u0435\u0431\u0440\u0430 <code>(x, y) \u2208 E_M<\/code> \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u043e <code>L(x) &gt; L(y)<\/code>, \u0442\u043e \u0432\u043d\u0443\u0442\u0440\u0438\u043c\u043e\u0434\u0443\u043b\u044c\u043d\u044b\u0439 \u0433\u0440\u0430\u0444 <code>(V_M, E_M)<\/code> \u043d\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043d\u0438 \u043e\u0434\u043d\u043e\u0433\u043e \u0446\u0438\u043a\u043b\u0430. \u0422\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0438 \u0442\u0430\u043a\u043e\u0439 \u0433\u0440\u0430\u0444 \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f DAG\u2019\u043e\u043c, <strong>D<\/strong>irected <strong>A<\/strong>cyclic <strong>G<\/strong>raph.<\/p>\n<p><strong>\u0414\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u043e.<\/strong> \u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c, \u0432 \u0433\u0440\u0430\u0444\u0435 \u0435\u0441\u0442\u044c \u0446\u0438\u043a\u043b <code>x\u2081 \u2192 x\u2082 \u2192 ... \u2192 x\u2099 \u2192 x\u2081<\/code>. \u0422\u043e\u0433\u0434\u0430 \u0438\u0437 \u0443\u0441\u043b\u043e\u0432\u0438\u044f:<\/p>\n<pre><code>L(x\u2081) &gt; L(x\u2082) &gt; ... &gt; L(x\u2099) &gt; L(x\u2081)<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0447\u0442\u043e \u0434\u0430\u0451\u0442 <code>L(x\u2081) &gt; L(x\u2081)<\/code> \u2014 \u043f\u0440\u043e\u0442\u0438\u0432\u043e\u0440\u0435\u0447\u0438\u0435. \u0426\u0438\u043a\u043b\u0430 \u0431\u044b\u0442\u044c \u043d\u0435 \u043c\u043e\u0436\u0435\u0442. \u0427\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442 \u044d\u0442\u043e\u0442 \u043f\u0435\u0440\u0435\u0445\u043e\u0434. \u0426\u0438\u043a\u043b \u2014 \u044d\u0442\u043e \u043f\u0443\u0442\u044c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043d\u0430\u0441 \u0432 \u0438\u0441\u0445\u043e\u0434\u043d\u0443\u044e \u0442\u043e\u0447\u043a\u0443. \u041d\u043e \u043a\u0430\u0436\u0434\u043e\u0435 \u0440\u0435\u0431\u0440\u043e \u0432 \u044d\u0442\u043e\u043c \u043f\u0443\u0442\u0438 \u0441\u0442\u0440\u043e\u0433\u043e \u043e\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <code>L<\/code>: \u0441 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 \u043d\u0430 \u0432\u0442\u043e\u0440\u043e\u0439 (<code>L(x\u2081) &gt; L(x\u2082)<\/code>), \u0441\u043e \u0432\u0442\u043e\u0440\u043e\u0433\u043e \u043d\u0430 \u0442\u0440\u0435\u0442\u0438\u0439, \u0438 \u0442\u0430\u043a \u0434\u0430\u043b\u0435\u0435. \u041a \u043a\u043e\u043d\u0446\u0443 \u043f\u0443\u0442\u0438 \u043c\u044b \u043e\u0431\u044f\u0437\u0430\u043d\u044b \u043e\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f <strong>\u0441\u0442\u0440\u043e\u0433\u043e \u043d\u0438\u0436\u0435<\/strong> \u0441\u0442\u0430\u0440\u0442\u043e\u0432\u043e\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u2014 \u0438 \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u0432 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0439 \u0442\u043e\u0447\u043a\u0435, \u0433\u0434\u0435 <code>L<\/code> \u0441\u043d\u043e\u0432\u0430 \u0440\u0430\u0432\u043d\u043e \u0441\u0442\u0430\u0440\u0442\u043e\u0432\u043e\u043c\u0443. \u00ab\u0421\u0442\u0440\u043e\u0433\u043e \u043d\u0438\u0436\u0435\u00bb \u0438 \u00ab\u0442\u043e \u0436\u0435 \u0441\u0430\u043c\u043e\u0435\u00bb \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u2014 \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e. \u042d\u0442\u043e \u0438 \u0435\u0441\u0442\u044c \u043f\u0440\u043e\u0442\u0438\u0432\u043e\u0440\u0435\u0447\u0438\u0435.<\/p>\n<p>\u0412 FBCA \u044d\u0442\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043f\u043e \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044e: \u043a\u0430\u0436\u0434\u044b\u0439 \u0444\u0430\u0439\u043b \u0436\u0438\u0432\u0451\u0442 \u0432 \u043e\u0434\u043d\u043e\u043c \u0438\u0437 \u0441\u043b\u043e\u0451\u0432, \u0438 \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0438\u043c\u043f\u043e\u0440\u0442\u043e\u0432 \u0437\u0430\u0434\u0430\u043d\u043e \u043a\u043e\u043d\u0432\u0435\u043d\u0446\u0438\u0435\u0439. External \u0432\u044b\u0441\u0442\u0443\u043f\u0430\u0435\u0442 \u0444\u0430\u0441\u0430\u0434\u043e\u043c \u043d\u0430\u0434 use-case\u2019\u0430\u043c\u0438 <strong>\u0441\u0432\u043e\u0435\u0433\u043e<\/strong> \u043c\u043e\u0434\u0443\u043b\u044f \u2014 \u043e\u043d \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u0442 handler\u2019\u044b (<code>L(external) = 3 &gt; L(use-case) = 2<\/code>), \u0430 \u043d\u0435 \u043d\u0430\u043e\u0431\u043e\u0440\u043e\u0442.<\/p>\n<p><strong>\u041c\u0435\u0436\u043c\u043e\u0434\u0443\u043b\u044c\u043d\u044b\u0439 \u0433\u0440\u0430\u0444.<\/strong> \u0412\u043d\u0443\u0442\u0440\u0438\u043c\u043e\u0434\u0443\u043b\u044c\u043d\u0430\u044f L-\u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0433\u043e\u0432\u043e\u0440\u0438\u0442 \u043f\u0440\u043e \u0441\u0432\u044f\u0437\u0438 \u043c\u0435\u0436\u0434\u0443 \u043c\u043e\u0434\u0443\u043b\u044f\u043c\u0438 \u2014 \u0434\u043b\u044f \u043d\u0438\u0445 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u043e.<\/p>\n<ul>\n<li>\n<p><code>V_inter<\/code> \u2014 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b<\/p>\n<\/li>\n<li>\n<p>\u0420\u0451\u0431\u0440\u0430 \u2014 \u00ab\u043c\u043e\u0434\u0443\u043b\u044c X \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u0442 \u043a\u043e\u0434 \u043c\u043e\u0434\u0443\u043b\u044f Y\u00bb<\/p>\n<\/li>\n<\/ul>\n<p><strong>\u041f\u0440\u0430\u0432\u0438\u043b\u043e.<\/strong> \u041b\u044e\u0431\u043e\u0439 \u0438\u043c\u043f\u043e\u0440\u0442 \u0438\u0437 \u043c\u043e\u0434\u0443\u043b\u044f X \u0432 \u043c\u043e\u0434\u0443\u043b\u044c Y \u0440\u0430\u0437\u0440\u0435\u0448\u0451\u043d \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0435\u0440\u0435\u0437 <code>external\/<\/code>-\u043f\u043e\u0440\u0442 \u043c\u043e\u0434\u0443\u043b\u044f Y. \u0421\u0430\u043c external \u0434\u0440\u0443\u0433\u0438\u0445 \u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u043d\u0435 \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u0442 \u2014 \u044d\u0442\u043e \u0435\u0433\u043e \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u0438\u0432\u043d\u043e\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e: \u043e\u043d \u0434\u0435\u043a\u043b\u0430\u0440\u0438\u0440\u0443\u0435\u0442 \u043f\u043e\u0432\u0435\u0440\u0445\u043d\u043e\u0441\u0442\u044c \u0441\u0432\u043e\u0435\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044f \u0438 \u0434\u0435\u043b\u0435\u0433\u0438\u0440\u0443\u0435\u0442 \u0432\u043e \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0435 handler\u2019\u044b \u0442\u043e\u0433\u043e \u0436\u0435 \u043c\u043e\u0434\u0443\u043b\u044f, \u0438 \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0438\u0447\u0435\u0433\u043e.<\/p>\n<p><strong>\u0421\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u0435.<\/strong> \u0426\u0438\u043a\u043b <code>M\u2081 \u2192 M\u2082 \u2192 ... \u2192 M\u2099 \u2192 M\u2081<\/code> \u043f\u043e\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043b \u0431\u044b, \u0447\u0442\u043e\u0431\u044b \u043a\u0430\u0436\u0434\u044b\u0439 \u043c\u043e\u0434\u0443\u043b\u044c \u0432 \u0446\u0435\u043f\u043e\u0447\u043a\u0435 \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043b external \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e. \u041d\u043e \u0435\u0441\u043b\u0438 <code>M\u2081.external<\/code> \u043d\u0438\u0447\u0435\u0433\u043e \u0438\u0437\u0432\u043d\u0435 \u043c\u043e\u0434\u0443\u043b\u044f \u043d\u0435 \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u0442, \u0440\u0435\u0431\u0440\u043e <code>M\u2099 \u2192 M\u2081<\/code> \u0438\u0434\u0442\u0438 \u043f\u043e\u043f\u0440\u043e\u0441\u0442\u0443 \u043d\u0435\u043e\u0442\u043a\u0443\u0434\u0430 \u2014 \u044d\u0442\u043e \u043d\u0430\u0440\u0443\u0448\u0435\u043d\u0438\u0435 \u0441\u0430\u043c\u043e\u0433\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u0430. \u0426\u0438\u043a\u043b \u043c\u0435\u0436\u0434\u0443 \u043c\u043e\u0434\u0443\u043b\u044f\u043c\u0438 \u0442\u043e\u043f\u043e\u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438 \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u0435\u043d.<\/p>\n<p>\u0418\u0442\u043e\u0433: <strong>\u0433\u0440\u0430\u0444 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u2014 DAG \u043a\u0430\u043a \u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044f (\u0447\u0435\u0440\u0435\u0437 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0441\u043b\u043e\u044f), \u0442\u0430\u043a \u0438 \u043c\u0435\u0436\u0434\u0443 \u043c\u043e\u0434\u0443\u043b\u044f\u043c\u0438 (\u0447\u0435\u0440\u0435\u0437 external-only-\u043f\u0440\u0430\u0432\u0438\u043b\u043e).<\/strong><\/p>\n<p>\u042d\u0442\u043e \u0444\u043e\u0440\u043c\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0444\u0440\u0430\u0437\u044b \u00ab\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u0442\u0435\u043a\u0443\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u043e\u0434\u043d\u0443 \u0441\u0442\u043e\u0440\u043e\u043d\u0443\u00bb. \u0412 feature-based \u043d\u0438 L, \u043d\u0438 external-\u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u043d\u0435\u0442: \u0441\u0435\u0440\u0432\u0438\u0441\u044b \u043c\u043e\u0433\u0443\u0442 \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u0440\u0443\u0433 \u0434\u0440\u0443\u0433\u0430 \u0432 \u043b\u044e\u0431\u043e\u043c \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0438, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0446\u0438\u043a\u043b\u044b \u0442\u043e\u043f\u043e\u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b \u2014 \u0447\u0442\u043e \u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442\u0441\u044f \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435 (\u0442\u043e\u0442 \u0441\u0430\u043c\u044b\u0439 \u0441\u043b\u0443\u0447\u0430\u0439 \u0438\u0437 \u0447\u0430\u0441\u0442\u0438 3).<\/p>\n<h3>\u0427\u0442\u043e \u044d\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442 \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435 (\u0438 \u043f\u0440\u0438 \u0447\u0451\u043c \u0442\u0443\u0442 forwardRef)<\/h3>\n<p>\u0421\u0430\u043c\u044b\u0439 \u043f\u043e\u043d\u044f\u0442\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u043e\u0431\u044a\u044f\u0441\u043d\u0438\u0442\u044c, \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0435 DAG, \u2014 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u0442\u044c, \u0447\u0442\u043e \u0432\u044b \u0438\u0434\u0451\u0442\u0435 \u043f\u043e \u0433\u0440\u0430\u0444\u0443 \u043f\u0435\u0448\u043a\u043e\u043c, \u043f\u043e \u0441\u0442\u0440\u0435\u043b\u043a\u0430\u043c.<\/p>\n<p>\u0412 FBCA \u043a\u0430\u0436\u0434\u044b\u0439 \u0448\u0430\u0433 \u0441\u0442\u0440\u043e\u0433\u043e \u043e\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u0432\u0430\u0441 \u043f\u043e \u0441\u043b\u043e\u044f\u043c: \u0441 <code>presentation<\/code> \u043a <code>use-case<\/code>, \u0441 <code>use-case<\/code> \u043a <code>infrastructure<\/code>, \u0441 <code>infrastructure<\/code> \u043a <code>domain<\/code>. \u0414\u043e\u0448\u043b\u0438 \u0434\u043e <code>domain<\/code> \u2014 \u043e\u0442\u0442\u0443\u0434\u0430 \u0441\u0442\u0440\u0435\u043b\u043e\u043a \u0434\u0430\u043b\u044c\u0448\u0435 \u043d\u0435\u0442. \u041f\u0440\u043e\u0433\u0443\u043b\u043a\u0430 \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u043b\u0430\u0441\u044c \u0435\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e.<\/p>\n<p>\u0412 \u0433\u0440\u0430\u0444\u0435 \u0441 \u0446\u0438\u043a\u043b\u043e\u043c \u0442\u0430\u043a\u043e\u0433\u043e \u00ab\u043a\u043e\u043d\u0446\u0430\u00bb \u043d\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442. \u0412\u044b \u043f\u043e\u0448\u043b\u0438 \u043f\u043e \u0441\u0442\u0440\u0435\u043b\u043a\u0435, \u043f\u043e\u0442\u043e\u043c \u043f\u043e \u0432\u0442\u043e\u0440\u043e\u0439, \u043f\u043e\u0442\u043e\u043c \u043f\u043e \u0442\u0440\u0435\u0442\u044c\u0435\u0439 \u2014 \u0438 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u043b\u0438, \u0447\u0442\u043e \u0432\u0435\u0440\u043d\u0443\u043b\u0438\u0441\u044c \u0442\u0443\u0434\u0430, \u043e\u0442\u043a\u0443\u0434\u0430 \u0441\u0442\u0430\u0440\u0442\u043e\u0432\u0430\u043b\u0438. \u0418 \u043f\u043e\u0439\u0434\u0451\u0442\u0435 \u043f\u043e \u0442\u043e\u043c\u0443 \u0436\u0435 \u043a\u0440\u0443\u0433\u0443 \u0441\u043d\u043e\u0432\u0430, \u0438 \u0441\u043d\u043e\u0432\u0430, \u0438 \u0442\u0430\u043a \u0434\u043e \u0431\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0441\u0442\u0438. \u0415\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c\u0441\u044f \u2014 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u0437\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u0442\u044c \u00ab\u0437\u0434\u0435\u0441\u044c \u044f \u0443\u0436\u0435 \u0431\u044b\u043b\u00bb.<\/p>\n<p>\u042d\u0442\u043e \u0440\u043e\u0432\u043d\u043e \u0442\u043e, \u0447\u0442\u043e NestJS \u0434\u0435\u043b\u0430\u0435\u0442 \u0447\u0435\u0440\u0435\u0437 <code>forwardRef<\/code>. \u041a\u043e\u0433\u0434\u0430 DI-\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u0435\u0442 \u0446\u0438\u043a\u043b\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c, \u043e\u043d \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0440\u0430\u0437\u0440\u0435\u0448\u0438\u0442\u044c \u0435\u0451 \u00ab\u0447\u0435\u0441\u0442\u043d\u043e\u00bb \u2014 \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0431\u044b \u0441\u043e\u0437\u0434\u0430\u0442\u044c <code>A<\/code>, \u0447\u0442\u043e\u0431\u044b \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0435\u0433\u043e \u0432 <code>B<\/code>, \u043d\u043e <code>B<\/code> \u043d\u0443\u0436\u0435\u043d \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f <code>A<\/code>. <code>forwardRef<\/code> \u0433\u043e\u0432\u043e\u0440\u0438\u0442 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0443: \u00ab\u043f\u043e\u0433\u043e\u0434\u0438 \u0438\u043d\u0441\u0442\u0430\u043d\u0446\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u0435\u0439\u0447\u0430\u0441, \u044f \u0432\u0435\u0440\u043d\u0443\u0441\u044c \u043a \u044d\u0442\u043e\u0439 \u0441\u0432\u044f\u0437\u0438 \u043f\u043e\u0437\u0436\u0435\u00bb. \u0422\u043e \u0435\u0441\u0442\u044c \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a \u0441\u0430\u043c \u0434\u0435\u043b\u0430\u0435\u0442 \u0441\u0435\u0431\u0435 \u043e\u0442\u043c\u0435\u0442\u043a\u0443 \u00ab\u0443\u0436\u0435 \u0432\u0438\u0434\u0435\u043b\u0438\u00bb, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u0443\u0439\u0442\u0438 \u0432 \u0437\u0430\u0446\u0438\u043a\u043b\u0438\u0432\u0430\u043d\u0438\u0435.<\/p>\n<p>\u0412 FBCA-\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435 \u0442\u0430\u043a\u043e\u0439 \u043a\u043e\u0441\u0442\u044b\u043b\u044c \u043d\u0435 \u043d\u0443\u0436\u0435\u043d \u0432 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0435. \u0413\u0440\u0430\u0444\u0443 \u043d\u0435\u043a\u0443\u0434\u0430 \u0437\u0430\u0446\u0438\u043a\u043b\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u2014 \u0443 \u043a\u0430\u0436\u0434\u043e\u0439 \u043f\u0440\u043e\u0433\u0443\u043b\u043a\u0438 \u043f\u043e \u0441\u0442\u0440\u0435\u043b\u043a\u0430\u043c \u0435\u0441\u0442\u044c \u0435\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u043a\u043e\u043d\u0435\u0446 \u043d\u0430 \u0434\u043e\u043c\u0435\u043d\u043d\u043e\u043c \u0441\u043b\u043e\u0435. NestJS \u0440\u0435\u0437\u043e\u043b\u0432\u0438\u0442 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u0432 \u043e\u0434\u0438\u043d \u043f\u0440\u043e\u0445\u043e\u0434, \u0431\u0435\u0437 \u043e\u0442\u043c\u0435\u0442\u043e\u043a \u0438 \u0431\u0435\u0437 <code>forwardRef<\/code>.<\/p>\n<h3>2. \u0413\u0440\u0430\u043d\u0438\u0446\u0430 \u0441\u0432\u044f\u0437\u043d\u043e\u0441\u0442\u0438 (coupling bound)<\/h3>\n<p>\u0421\u0432\u044f\u0437\u043d\u043e\u0441\u0442\u044c \u043c\u043e\u0434\u0443\u043b\u044f = \u0440\u0430\u0437\u043c\u0435\u0440 \u0435\u0433\u043e \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u043e\u0433\u043e API.<\/p>\n<p>\u0412 feature-based:<\/p>\n<pre><code>API(M) = \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u0432\u0441\u0435\u0445 \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0432\u0441\u0435\u0445 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432, \u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0438\u0437 M<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u042d\u0442\u043e\u0442 \u0440\u0430\u0437\u043c\u0435\u0440 \u0440\u0430\u0441\u0442\u0451\u0442 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0441 \u043a\u0430\u0436\u0434\u044b\u043c \u043d\u043e\u0432\u044b\u043c \u043c\u0435\u0442\u043e\u0434\u043e\u043c \u043b\u044e\u0431\u043e\u0433\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u0430.<\/p>\n<p>\u0412 FBCA:<\/p>\n<pre><code>API(M) = \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b M.external<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0420\u0430\u0437\u043c\u0435\u0440 \u0440\u0430\u0441\u0442\u0451\u0442 <strong>\u0442\u043e\u043b\u044c\u043a\u043e<\/strong> \u043f\u0440\u0438 \u044f\u0432\u043d\u043e\u043c \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0438 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0432 <code>external\/<\/code>-\u043f\u043e\u0440\u0442.<\/p>\n<p><strong>\u0421\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u0435.<\/strong> \u041f\u0440\u0438 \u0440\u0430\u0432\u043d\u043e\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u0435 <code>|API_FBCA(M)| \u2264 |API_FB(M)|<\/code>, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0432 FB \u043b\u044e\u0431\u043e\u0439 \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 \u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u0447\u0430\u0441\u0442\u044c\u044e API \u043c\u043e\u0434\u0443\u043b\u044f, \u0430 \u0432 FBCA \u2014 \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u043e, \u0447\u0442\u043e \u044f\u0432\u043d\u043e \u0432\u044b\u043b\u043e\u0436\u0435\u043d\u043e \u0432 <code>external\/<\/code>.<\/p>\n<p>\u0412 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u0445 \u0442\u0435\u043e\u0440\u0438\u0438 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438: \u0441\u0432\u044f\u0437\u043d\u043e\u0441\u0442\u044c \u043a\u0430\u043a \u0432\u0437\u0430\u0438\u043c\u043d\u0430\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043c\u0435\u0436\u0434\u0443 \u043f\u043e\u0442\u0440\u0435\u0431\u0438\u0442\u0435\u043b\u0435\u043c \u0438 \u043c\u043e\u0434\u0443\u043b\u0435\u043c \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0430 \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u043c API. FBCA-\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0436\u0451\u0441\u0442\u043a\u043e \u043b\u0438\u043c\u0438\u0442\u0438\u0440\u0443\u0435\u0442 \u043f\u043e\u0432\u0435\u0440\u0445\u043d\u043e\u0441\u0442\u044c, \u0447\u0435\u0440\u0435\u0437 \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e\u0435 \u0441\u0432\u044f\u0437\u044b\u0432\u0430\u043d\u0438\u0435.<\/p>\n<h3>3. \u0421\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u044c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f (cost of change)<\/h3>\n<p>\u041f\u0443\u0441\u0442\u044c <code>F<\/code> \u2014 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c\u0430\u044f \u0444\u0438\u0447\u0430.<\/p>\n<p>\u0412 FB \u043f\u0440\u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0438 \u043c\u0435\u0442\u043e\u0434\u0430 \u0432 god-\u0441\u0435\u0440\u0432\u0438\u0441 <code>S<\/code>:<\/p>\n<ul>\n<li>\n<p>\u0417\u0430\u043f\u0438\u0441\u044c \u043d\u043e\u0432\u043e\u0439 \u043b\u043e\u0433\u0438\u043a\u0438: <code>O(1)<\/code> \u0441\u0442\u0440\u043e\u043a<\/p>\n<\/li>\n<li>\n<p>\u0421\u043a\u0440\u044b\u0442\u043e\u0435 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 \u043f\u043e\u0432\u0435\u0440\u0445\u043d\u043e\u0441\u0442\u0438: <code>O(|consumers(S)|)<\/code> \u043f\u043e\u0442\u0440\u0435\u0431\u0438\u0442\u0435\u043b\u0435\u0439 \u0442\u0435\u043f\u0435\u0440\u044c \u0438\u043c\u0435\u044e\u0442 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u043d\u043e\u0432\u043e\u0439 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438<\/p>\n<\/li>\n<li>\n<p>\u0412\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0435 \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u0438: \u043f\u0440\u043e\u043f\u043e\u0440\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b \u0447\u0438\u0441\u043b\u0443 \u043f\u043e\u0442\u0440\u0435\u0431\u0438\u0442\u0435\u043b\u0435\u0439<\/p>\n<\/li>\n<\/ul>\n<p>\u0412 FBCA \u043f\u0440\u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0438 \u043d\u043e\u0432\u043e\u0439 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438:<\/p>\n<ul>\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043d\u043e\u0432\u043e\u0439 \u043f\u0430\u043f\u043a\u0438 <code>&lt;verb-noun&gt;\/<\/code> \u0441 handler\u2019\u043e\u043c \u0438 \u043c\u043e\u0434\u0443\u043b\u0435\u043c: <code>O(1)<\/code> \u0441\u0442\u0440\u043e\u043a<\/p>\n<\/li>\n<li>\n<p>\u0421\u043a\u0440\u044b\u0442\u043e\u0435 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 \u043f\u043e\u0432\u0435\u0440\u0445\u043d\u043e\u0441\u0442\u0438: <code>O(0)<\/code> \u2014 \u043d\u0438 \u043e\u0434\u0438\u043d \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 handler \u043d\u0435 \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f, \u043d\u0438 \u043e\u0434\u0438\u043d external-\u0441\u0435\u0440\u0432\u0438\u0441 \u043d\u0435 \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u0435\u0442\u0441\u044f<\/p>\n<\/li>\n<\/ul>\n<p>\u041a\u0430\u0447\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e:<\/p>\n<pre><code>IncrementalCost_FB(F)   \u2208 O(|consumers|)IncrementalCost_FBCA(F) \u2208 O(1)<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u042d\u0442\u043e \u0438 \u0435\u0441\u0442\u044c \u0442\u0430 \u00ab\u043f\u043b\u043e\u0441\u043a\u043e\u0441\u0442\u044c \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u0438\u00bb, \u043e \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0448\u043b\u0430 \u0440\u0435\u0447\u044c \u0440\u0430\u043d\u044c\u0448\u0435: \u0432 FB \u0446\u0435\u043d\u0430 \u043a\u0430\u0436\u0434\u043e\u0439 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0444\u0438\u0447\u0438 \u0440\u0430\u0441\u0442\u0451\u0442 \u0441 \u0447\u0438\u0441\u043b\u043e\u043c \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 \u043f\u043e\u0442\u0440\u0435\u0431\u0438\u0442\u0435\u043b\u0435\u0439; \u0432 FBCA \u043e\u043d\u0430 \u043e\u0441\u0442\u0430\u0451\u0442\u0441\u044f \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u043e\u0439.<\/p>\n<h3>\u041f\u0440\u0438 \u043a\u0430\u043a\u0438\u0445 \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u0445 \u044d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442<\/h3>\n<p>\u0412\u0441\u0435 \u0442\u0440\u0438 \u0443\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u044f <strong>\u043e\u0431\u0443\u0441\u043b\u043e\u0432\u043b\u0435\u043d\u044b<\/strong> \u0442\u0440\u0435\u043c\u044f \u0438\u043d\u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430\u043c\u0438:<\/p>\n<ol>\n<li>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u044f <code>L<\/code> \u043c\u043e\u043d\u043e\u0442\u043e\u043d\u043d\u0430 \u2014 \u043d\u0438\u043a\u0430\u043a\u0438\u0445 \u0440\u0451\u0431\u0435\u0440 \u00ab\u0432\u0432\u0435\u0440\u0445\u00bb: handler \u043d\u0435 \u0437\u043e\u0432\u0451\u0442 presentation, repository \u043d\u0435 \u0437\u043e\u0432\u0451\u0442 use-case.<\/p>\n<\/li>\n<li>\n<p>\u041a\u0430\u0436\u0434\u044b\u0439 \u043c\u043e\u0434\u0443\u043b\u044c \u043f\u0443\u0431\u043b\u0438\u043a\u0443\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e <code>external\/<\/code>-\u043f\u043e\u0440\u0442. \u0412\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0435 handler\u2019\u044b \u0438 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438 \u043d\u0438\u0433\u0434\u0435 \u043d\u0430\u0440\u0443\u0436\u0443 \u043d\u0435 \u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u044b.<\/p>\n<\/li>\n<li>\n<p>Use-case \u043d\u0435 \u0437\u043e\u0432\u0451\u0442 \u0441\u043e\u0441\u0435\u0434\u043d\u0438\u0439 use-case. \u041e\u0431\u0449\u0430\u044f \u043b\u043e\u0433\u0438\u043a\u0430 \u043e\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u0432\u043d\u0438\u0437 \u2014 \u0432 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 \u0438\u043b\u0438 \u0432 \u0434\u043e\u043c\u0435\u043d, \u2014 \u0430 \u043d\u0435 \u0440\u0430\u0437\u043c\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432\u0431\u043e\u043a.<\/p>\n<\/li>\n<\/ol>\n<p>\u0411\u0435\u0437 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u044d\u0442\u0438\u0445 \u0443\u0441\u043b\u043e\u0432\u0438\u0439 \u0434\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u0430 \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442. \u0422\u043e \u0435\u0441\u0442\u044c \u0441\u0442\u0440\u043e\u0433\u043e \u0443\u0442\u0432\u0435\u0440\u0436\u0434\u0430\u0442\u044c \u043c\u043e\u0436\u043d\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435:<\/p>\n<blockquote>\n<p>\u041f\u0440\u0438 \u0441\u043e\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u0438 \u0438\u043d\u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432 \u0441\u043b\u043e\u0451\u0432 \u0438 external-\u043f\u043e\u0440\u0442\u043e\u0432 \u0433\u0440\u0430\u0444 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f DAG\u2019\u043e\u043c, \u0440\u0430\u0437\u043c\u0435\u0440 API \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u043c external-\u043f\u043e\u0432\u0435\u0440\u0445\u043d\u043e\u0441\u0442\u0438, \u0438 \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u044c \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0444\u0438\u0447\u0438 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u043d\u0430.<\/p>\n<\/blockquote>\n<p>\u0422\u043e, \u0447\u0442\u043e <strong>\u0434\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f<\/strong> \u2014 \u044d\u0442\u043e \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043d\u044b\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u043f\u0440\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0445 \u043f\u0440\u0430\u0432\u0438\u043b. \u0418\u043c\u0435\u043d\u043d\u043e \u044d\u0442\u0438 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 (\u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u0446\u0438\u043a\u043b\u043e\u0432, \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u043d\u0430\u044f \u0441\u0432\u044f\u0437\u043d\u043e\u0441\u0442\u044c, \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u043d\u0430\u044f \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u044c \u0438\u043d\u043a\u0440\u0435\u043c\u0435\u043d\u0442\u0430) \u0438 \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u0435 \u0442\u0435\u0440\u043c\u0438\u043d\u0430 \u00ab\u043d\u0435 \u0434\u0435\u0433\u0440\u0430\u0434\u0438\u0440\u0443\u0435\u0442\u00bb.<\/p>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0442\u0435\u043f\u0435\u0440\u044c \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0438 \u043c\u043e\u0443\u0434\u043b\u044f <code>Users<\/code>, \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u043c \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0433\u0440\u0430\u0444\u043e\u0432 \u0438 \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u0441\u043d\u0438\u043c\u043e\u043a \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f<\/p>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/\/post_images\/130\/f90\/017\/130f90017b2fa1714dc1d09eff477ac1.svg\" alt=\"\u0413\u0440\u0430\u0444 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 FBCA: \u043c\u043e\u0434\u0443\u043b\u0438 Auth \u0438 Users\" sizes=\"(max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/\/post_images\/130\/f90\/017\/130f90017b2fa1714dc1d09eff477ac1.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/\/post_images\/130\/f90\/017\/130f90017b2fa1714dc1d09eff477ac1.svg 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<div><figcaption>\u0413\u0440\u0430\u0444 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 FBCA: \u043c\u043e\u0434\u0443\u043b\u0438 Auth \u0438 Users<\/figcaption><\/div>\n<\/figure>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u043c, \u0447\u0442\u043e \u043f\u0440\u043e\u0448\u0451\u043b \u0433\u043e\u0434 \u044d\u043a\u0441\u043f\u043b\u0443\u0430\u0442\u0430\u0446\u0438\u0438 \u0432 \u043f\u0440\u043e\u0434\u0430\u043a\u0448\u0435\u043d\u0435. \u0421\u043e\u0441\u0442\u0430\u0432 use-case\u2019\u043e\u0432 \u043d\u0430 \u0433\u0440\u0430\u0444\u0435 \u043d\u0438\u0436\u0435 \u2014 \u044d\u0442\u043e \u043d\u0435 \u043f\u0440\u0435\u0432\u0435\u043d\u0442\u0438\u0432\u043d\u0430\u044f \u0434\u0435\u043a\u043e\u043c\u043f\u043e\u0437\u0438\u0446\u0438\u044f, \u0430 \u043d\u0430\u043a\u043e\u043f\u043b\u0435\u043d\u043d\u044b\u0439 \u043e\u0442\u0432\u0435\u0442 \u043d\u0430 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0435 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f \u0438 \u0438\u043d\u0446\u0438\u0434\u0435\u043d\u0442\u044b: \u043a\u0430\u0436\u0434\u0430\u044f \u0433\u0440\u0443\u043f\u043f\u0430 \u0432\u043e\u0437\u043d\u0438\u043a\u043b\u0430 \u043a\u0430\u043a \u043e\u0442\u0432\u0435\u0442 \u043d\u0430 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 \u043f\u0440\u043e\u0434\u0430\u043a\u0442\u0430, \u0438\u043d\u0446\u0438\u0434\u0435\u043d\u0442 \u0438\u043b\u0438 \u0440\u0435\u0433\u0443\u043b\u044f\u0442\u043e\u0440\u043d\u043e\u0435 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u0435. \u041a\u0440\u0430\u0442\u043a\u043e \u043f\u043e \u0433\u0440\u0443\u043f\u043f\u0430\u043c \u0441 \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u0435\u043c \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0430 \u043a\u0430\u0436\u0434\u043e\u0439.<\/p>\n<p><strong>Presentation (\u0447\u0442\u043e \u044e\u0437\u0435\u0440 \u0434\u0435\u043b\u0430\u0435\u0442 \u0441\u043e \u0441\u0432\u043e\u0438\u043c \u0430\u043a\u043a\u0430\u0443\u043d\u0442\u043e\u043c):<\/strong><\/p>\n<ul>\n<li>\n<p><strong>\u041f\u0440\u043e\u0444\u0438\u043b\u044c.<\/strong> \u0411\u0430\u0437\u043e\u0432\u0430\u044f \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430 \u00ab\u0443 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u044e\u0437\u0435\u0440\u0430 \u0435\u0441\u0442\u044c \u043f\u0440\u043e\u0444\u0438\u043b\u044c\u00bb \u043e\u0431\u0440\u043e\u0441\u043b\u0430 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u043c\u0438 \u0440\u0443\u0447\u043a\u0430\u043c\u0438 \u043f\u043e\u0441\u043b\u0435 A\/B-\u0442\u0435\u0441\u0442\u043e\u0432 \u043d\u0430 inline-\u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 (bio, avatar) \u0438 \u0438\u043d\u0446\u0438\u0434\u0435\u043d\u0442\u043e\u0432 \u0441\u043e \u0441\u043c\u0435\u043d\u043e\u0439 <code>username<\/code> \u0438 \u043f\u043e\u0434\u0434\u0435\u043b\u043a\u043e\u0439 <code>displayName<\/code>.<\/p>\n<\/li>\n<li>\n<p><strong>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438.<\/strong> \u041f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u0443\u0441\u0442\u0430\u043b\u0430 \u043e\u0442 \u0442\u0438\u043a\u0435\u0442\u043e\u0432 \u00ab\u043d\u0435 \u043c\u043e\u0433\u0443 \u043e\u0442\u043f\u0438\u0441\u0430\u0442\u044c\u0441\u044f \u043e\u0442 \u043f\u0438\u0441\u0435\u043c\u00bb \u2014 \u0432\u044b\u0434\u0435\u043b\u0438\u043b\u0438 email-prefs \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 flow. Privacy \u0438 blocking-rules \u2014 \u043f\u043e\u0434 GDPR \u0438 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u043d\u044b\u0435 \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0438. Language \u0438 theme \u0440\u0430\u0437\u043d\u0435\u0441\u0435\u043d\u044b \u043f\u043e\u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u0443 \u043a\u0430\u0436\u0434\u043e\u0439 \u0441\u0432\u043e\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u0439 \u043f\u043e\u0442\u043e\u043a (i18n-\u043a\u044d\u0448, sync \u0442\u0435\u043c\u044b \u043c\u0435\u0436\u0434\u0443 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430\u043c\u0438).<\/p>\n<\/li>\n<li>\n<p><strong>\u042f \u0438 \u043c\u043e\u0438 \u0434\u0430\u043d\u043d\u044b\u0435.<\/strong> <code>me<\/code>-endpoint \u0438 stats \u2014 \u0431\u0430\u0437\u043e\u0432\u0430\u044f \u043f\u043e\u0432\u0435\u0440\u0445\u043d\u043e\u0441\u0442\u044c \u0434\u043b\u044f \u0444\u0440\u043e\u043d\u0442\u0430. Engagement-stats \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0430\u0441\u044c \u043f\u043e\u0441\u043b\u0435 \u0440\u0435\u043b\u0438\u0437\u0430 creator-tools.<\/p>\n<\/li>\n<li>\n<p><strong>GDPR \/ Compliance.<\/strong> \u0423\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u0441 14-\u0434\u043d\u0435\u0432\u043d\u044b\u043c \u043e\u043a\u043d\u043e\u043c, \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u0438 \u044d\u043a\u0441\u043f\u043e\u0440\u0442 \u0432\u0441\u0435\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 JSON \u2014 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u0442\u0440\u043e\u0438\u0446\u0430 \u043f\u043e GDPR\/CCPA.<\/p>\n<\/li>\n<\/ul>\n<p><strong>External (\u0447\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0441\u0435\u0434\u043d\u0438\u043c \u043c\u043e\u0434\u0443\u043b\u044f\u043c):<\/strong><\/p>\n<ul>\n<li>\n<p><strong>Identity.<\/strong> \u0411\u0430\u0437\u043e\u0432\u044b\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u00ab\u0441\u043e\u0437\u0434\u0430\u0442\u044c \/ \u043d\u0430\u0439\u0442\u0438 \/ \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u044e\u0437\u0435\u0440\u0430\u00bb. \u0427\u0430\u0441\u0442\u044c \u0432\u0432\u0435\u0434\u0435\u043d\u0430 \u0441 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0434\u043d\u044f (\u0434\u043b\u044f Auth), \u0447\u0430\u0441\u0442\u044c \u2014 \u043f\u043e\u0441\u043b\u0435 \u0438\u043d\u0446\u0438\u0434\u0435\u043d\u0442\u043e\u0432: <code>bulk-get-users<\/code> \u043f\u043e\u0441\u043b\u0435 \u043f\u0435\u0440\u0432\u043e\u0439 \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u043e\u0439 \u043b\u0435\u043d\u0442\u044b \u0441 N+1, <code>check-user-exists<\/code> \u043f\u043e\u0441\u043b\u0435 \u0430\u043d\u0430\u043b\u0438\u0437\u0430 DB-\u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438 (\u00ab\u0437\u0430\u0447\u0435\u043c \u0442\u044f\u043d\u0443\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442, \u0435\u0441\u043b\u0438 \u043d\u0443\u0436\u0435\u043d boolean\u00bb), <code>display-info<\/code> \u2014 \u043e\u0431\u043b\u0435\u0433\u0447\u0451\u043d\u043d\u044b\u0439 \u043f\u0440\u043e\u0444\u0438\u043b\u044c \u0434\u043b\u044f \u0440\u0435\u043d\u0434\u0435\u0440\u0430 \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445.<\/p>\n<\/li>\n<li>\n<p><strong>Graph.<\/strong> \u0421\u043e\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u0433\u0440\u0430\u0444: \u043f\u043e\u0434\u043f\u0438\u0441\u043a\u0438, \u0432\u0438\u0434\u0438\u043c\u043e\u0441\u0442\u044c, \u043e\u043f\u043e\u0432\u0435\u0449\u0435\u043d\u0438\u044f. <code>can-view-content<\/code> \u043f\u043e\u044f\u0432\u0438\u043b\u0441\u044f \u043f\u043e\u0441\u043b\u0435 \u0440\u0435\u043b\u0438\u0437\u0430 \u043f\u0440\u0438\u0432\u0430\u0442\u043d\u044b\u0445 \u0430\u043a\u043a\u0430\u0443\u043d\u0442\u043e\u0432, <code>check-blocked-by<\/code> \u2014 \u043f\u043e\u0441\u043b\u0435 \u0438\u043d\u0446\u0438\u0434\u0435\u043d\u0442\u0430, \u043a\u043e\u0433\u0434\u0430 Feed \u0432\u044b\u0434\u0430\u0432\u0430\u043b \u043a\u043e\u043d\u0442\u0435\u043d\u0442 \u044e\u0437\u0435\u0440\u0430, \u0437\u0430\u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u0432\u0448\u0435\u0433\u043e \u0441\u043c\u043e\u0442\u0440\u044f\u0449\u0435\u0433\u043e.<\/p>\n<\/li>\n<li>\n<p><strong>Access.<\/strong> \u041f\u043e\u043b\u043d\u043e\u043c\u043e\u0447\u0438\u044f \u0438 \u0441\u0442\u0430\u0442\u0443\u0441\u044b: \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0438, \u0432\u0435\u0440\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f, \u0442\u0438\u0440\u044b (\u043f\u043e\u0441\u043b\u0435 \u043c\u043e\u043d\u0435\u0442\u0438\u0437\u0430\u0446\u0438\u0438), <code>get-user-since<\/code> \u0434\u043b\u044f \u0430\u043d\u0442\u0438-\u0444\u0440\u043e\u0434\u0430 (\u043d\u043e\u0432\u044b\u0439 \u0430\u043a\u043a\u0430\u0443\u043d\u0442 = \u043c\u0435\u043d\u044c\u0448\u0435 \u0434\u043e\u0432\u0435\u0440\u0438\u044f), <code>permissions<\/code> \u043f\u043e\u0441\u043b\u0435 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f \u0430\u0434\u043c\u0438\u043d\u043a\u0438.<\/p>\n<\/li>\n<\/ul>\n<p>\u0418 \u0447\u0442\u043e \u0432\u0430\u0436\u043d\u043e: \u0432 \u043a\u0430\u0436\u0434\u043e\u043c \u0438\u0437 \u044d\u0442\u0438\u0445 \u0441\u043b\u0443\u0447\u0430\u0435\u0432 \u043d\u043e\u0432\u0430\u044f \u0440\u0443\u0447\u043a\u0430 \u2014 \u044d\u0442\u043e <strong>\u043d\u043e\u0432\u0430\u044f \u043f\u0430\u043f\u043a\u0430 \u0440\u044f\u0434\u043e\u043c<\/strong>, \u0431\u0435\u0437 \u043f\u0440\u0430\u0432\u043e\u043a \u0441\u0442\u0430\u0440\u044b\u0445. \u0413\u0440\u0430\u0444 \u0440\u0430\u0441\u0442\u0451\u0442 \u0432\u0435\u0440\u0442\u0438\u043a\u0430\u043b\u044c\u043d\u043e, \u0430 \u043d\u0435 \u0432\u0448\u0438\u0440\u044c.<\/p>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/\/post_images\/19c\/a1c\/422\/19ca1c422490c5b12f2fe7895f69e1da.svg\" alt=\"\u0413\u0440\u0430\u0444 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 FBCA: \u043c\u043e\u0434\u0443\u043b\u0438 Auth \u0438 Users\" sizes=\"(max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/\/post_images\/19c\/a1c\/422\/19ca1c422490c5b12f2fe7895f69e1da.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/\/post_images\/19c\/a1c\/422\/19ca1c422490c5b12f2fe7895f69e1da.svg 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<div><figcaption>\u0413\u0440\u0430\u0444 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 FBCA: \u043c\u043e\u0434\u0443\u043b\u0438 Auth \u0438 Users<\/figcaption><\/div>\n<\/figure>\n<p>\u0413\u0440\u0430\u0444 \u0432\u044b\u0440\u043e\u0441 \u0432 \u0442\u0440\u0438 \u0440\u0430\u0437\u0430, \u0430 \u0444\u043e\u0440\u043c\u0430 \u0443 \u043d\u0435\u0433\u043e \u0442\u0430 \u0436\u0435. \u0422\u0435 \u0436\u0435 \u043f\u044f\u0442\u044c \u043a\u043e\u0440\u043e\u0431\u043e\u043a, \u0442\u0435 \u0436\u0435 \u0441\u0442\u0440\u0435\u043b\u043a\u0438 \u0441\u0432\u0435\u0440\u0445\u0443 \u0432\u043d\u0438\u0437. \u0415\u0441\u043b\u0438 \u0437\u0430\u0432\u0442\u0440\u0430 \u043f\u0440\u0438\u0434\u0451\u0442 \u0435\u0449\u0451 \u0442\u0440\u0438 \u0440\u0435\u043b\u0438\u0437\u0430 \u0438 use-case\u2019\u043e\u0432 \u0441\u0442\u0430\u043d\u0435\u0442 \u0448\u0435\u0441\u0442\u044c\u0434\u0435\u0441\u044f\u0442 \u2014 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0430 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043d\u043e \u043d\u0435 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u0441\u044f: \u0442\u0435 \u0436\u0435 \u043f\u044f\u0442\u044c \u043a\u043e\u0440\u043e\u0431\u043e\u043a, \u043f\u0440\u043e\u0441\u0442\u043e \u0432\u043d\u0443\u0442\u0440\u0438 HTML-\u043c\u0435\u0442\u043e\u043a \u0441\u0442\u0430\u043d\u0435\u0442 \u0442\u0435\u0441\u043d\u043e\u0432\u0430\u0442\u043e. \u041d\u0438\u043a\u0430\u043a\u0438\u0445 \u043d\u043e\u0432\u044b\u0445 \u0440\u0451\u0431\u0435\u0440, \u043d\u0438\u043a\u0430\u043a\u0438\u0445 \u043d\u043e\u0432\u044b\u0445 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0435\u0439 \u0433\u0440\u0430\u0444\u0430.<\/p>\n<p>\u042d\u0442\u043e \u0438 \u0435\u0441\u0442\u044c \u0442\u043e, \u0447\u0442\u043e \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u00ab\u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430 \u043e\u0441\u0442\u0430\u043b\u0430\u0441\u044c \u0432 \u0444\u043e\u0440\u043c\u0435\u00bb. \u041d\u0435 \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043c\u044b \u0435\u0451 \u043d\u0435 \u0442\u0440\u043e\u0433\u0430\u043b\u0438 \u2014 \u043c\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438 \u0434\u0435\u0441\u044f\u0442\u043a\u0438 \u043d\u043e\u0432\u044b\u0445 \u0444\u0430\u0439\u043b\u043e\u0432. \u0410 \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043c\u044b \u0435\u0451 \u043d\u0435 <strong>\u0434\u0435\u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043b\u0438<\/strong>: \u043d\u0435 \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0432\u0432\u043e\u0434\u0438\u0442\u044c \u043d\u043e\u0432\u044b\u0435 \u0442\u0438\u043f\u044b \u0441\u0432\u044f\u0437\u0435\u0439, \u043f\u0435\u0440\u0435\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 use-case\u2019\u044b \u043f\u043e\u0434 \u043d\u043e\u0432\u044b\u0435 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f \u0438\u043b\u0438 \u0440\u0430\u0437\u0440\u0443\u043b\u0438\u0432\u0430\u0442\u044c \u043d\u0430\u043a\u043e\u043f\u0438\u0432\u0448\u0438\u0435\u0441\u044f \u043a\u043e\u043c\u043f\u0440\u043e\u043c\u0438\u0441\u0441\u044b. \u041a\u0430\u0436\u0434\u043e\u0435 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u0435 \u043b\u0435\u0433\u043b\u043e \u043a\u0430\u043a \u043d\u043e\u0432\u0430\u044f \u043f\u0430\u043f\u043a\u0430 \u0440\u044f\u0434\u043e\u043c, \u0438 \u0441\u0442\u0430\u0440\u044b\u0435 \u043f\u0430\u043f\u043a\u0438 \u044d\u0442\u0438\u043c \u043d\u0435 \u0437\u0430\u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043e\u0432\u0430\u043b\u0438\u0441\u044c.<\/p>\n<\/div>\n<p>\u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/1038450\/\">https:\/\/habr.com\/ru\/articles\/1038450\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u0410\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u043d\u0430\u044f \u0434\u043e\u043a\u0442\u0440\u0438\u043d\u0430 \u0434\u043b\u044f NestJS-\u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432: \u0440\u0430\u0437\u0431\u043e\u0440 \u0442\u0438\u043f\u043e\u0432\u044b\u0445 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0435\u0432 \u0434\u0435\u0433\u0440\u0430\u0434\u0430\u0446\u0438\u0438 \u043a\u043e\u0434\u043e\u0432\u043e\u0439 \u0431\u0430\u0437\u044b \u0438 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043d\u044b\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f, \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u044e\u0449\u0438\u0435 \u0435\u0451 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u043f\u0440\u0438 \u0440\u043e\u0441\u0442\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u0430.\u0412 \u0447\u0430\u0441\u0442\u044f\u0445 1\u20132 \u043c\u044b \u043d\u0430\u0431\u043b\u044e\u0434\u0430\u043b\u0438, \u043a\u0430\u043a \u043f\u0440\u043e\u0441\u0442\u043e\u0439 signUp \u043f\u043e\u0434 \u043d\u0430\u043f\u043e\u0440\u043e\u043c \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u0439 \u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0430\u043b\u0441\u044f \u0432 god-\u0441\u0435\u0440\u0432\u0438\u0441 \u043d\u0430 \u0441\u043e\u0442\u043d\u0438 \u0441\u0442\u0440\u043e\u043a, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0437\u043d\u0430\u0435\u0442 \u043f\u0440\u043e \u0434\u0435\u0441\u044f\u0442\u043e\u043a \u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u0441\u0440\u0430\u0437\u0443. \u0412 \u0447\u0430\u0441\u0442\u0438 3 \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u043b\u0438, \u043a\u0430\u043a \u0438\u0437 \u044d\u0442\u043e\u0433\u043e \u0435\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0440\u043e\u0436\u0434\u0430\u044e\u0442\u0441\u044f forwardRef \u0438 \u0446\u0438\u043a\u043b\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u2014 \u0442\u043e\u0442 \u0441\u0430\u043c\u044b\u0439 \u043a\u043b\u0443\u0431\u043e\u043a, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0443\u0436\u0435 \u043d\u0435 \u0440\u0430\u0441\u043f\u0443\u0442\u0430\u0442\u044c. \u0412 \u0447\u0430\u0441\u0442\u0438 4 \u0441\u043f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043b\u0438 FBCA-\u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0443 \u0441 \u043d\u0443\u043b\u044f \u2014 domain \/ use-case \/ infrastructure \/ presentation \u0441\u043e \u0441\u043b\u043e\u044f\u043c\u0438, external-\u043f\u043e\u0440\u0442\u0430\u043c\u0438 \u0438 Result-\u043e\u0431\u0432\u044f\u0437\u043a\u043e\u0439 \u043e\u0448\u0438\u0431\u043e\u043a \u2014 \u0438 \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u0438, \u043a\u0430\u043a \u0442\u043e\u0442 \u0436\u0435 signUp \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0432 \u043d\u0435\u0439.\u0427\u0430\u0441\u0442\u044c 5 \u2014 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u0430\u044f \u0432\u0441\u0435\u043b\u0435\u043d\u043d\u0430\u044f \u0442\u043e\u0433\u043e \u0436\u0435 \u0441\u044e\u0436\u0435\u0442\u0430. \u0422\u0435 \u0436\u0435 \u0431\u0438\u0437\u043d\u0435\u0441-\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f, \u0447\u0442\u043e \u043f\u0440\u0438\u043b\u0435\u0442\u0435\u043b\u0438 \u0432 feature-based \u0432 \u0447\u0430\u0441\u0442\u044f\u0445 1\u20132, \u0442\u0435\u043f\u0435\u0440\u044c \u043f\u0440\u0438\u043b\u0435\u0442\u0430\u044e\u0442 \u0432 FBCA-\u043a\u043e\u0434\u043e\u0432\u0443\u044e \u0431\u0430\u0437\u0443 \u0438\u0437 \u0447\u0430\u0441\u0442\u0438 4: handler \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u043e\u0431\u0440\u0430\u0441\u0442\u0430\u0435\u0442 \u0442\u0435\u043c\u0438 \u0436\u0435 \u0432\u043d\u0435\u0448\u043d\u0438\u043c\u0438 \u0441\u0435\u0440\u0432\u0438\u0441\u0430\u043c\u0438 (\u0430\u043d\u0442\u0438-\u0444\u0440\u043e\u0434, \u0440\u0435\u0444\u0435\u0440\u0430\u043b\u043a\u0438, \u043f\u0430\u0440\u0442\u043d\u0451\u0440\u044b, \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u043a\u0430), \u043c\u043e\u0434\u0443\u043b\u044c Users \u2014 \u0442\u0435\u043c\u0438 \u0436\u0435 \u0444\u0438\u0447\u0430\u043c\u0438 (\u043f\u0440\u043e\u0444\u0438\u043b\u044c, \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438, \u043f\u0440\u0438\u0432\u0430\u0442\u043d\u043e\u0441\u0442\u044c, \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0430). \u0421\u043c\u043e\u0442\u0440\u0438\u043c, \u0447\u0442\u043e \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043f\u043e \u0444\u043e\u0440\u043c\u0435, \u0447\u0442\u043e \u2014 \u043f\u043e \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u044e, \u0438 \u043f\u043e\u0447\u0435\u043c\u0443 \u0433\u0440\u0430\u0444 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u043e\u0441\u0442\u0430\u0451\u0442\u0441\u044f \u0430\u0446\u0438\u043a\u043b\u0438\u0447\u043d\u044b\u043c \u0434\u0430\u0436\u0435 \u043f\u043e\u0441\u043b\u0435 \u043c\u043d\u043e\u0433\u043e\u043a\u0440\u0430\u0442\u043d\u043e\u0433\u043e \u0440\u043e\u0441\u0442\u0430. \u0412 \u043a\u043e\u043d\u0446\u0435 \u2014 \u0444\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u043e\u0431\u043e\u0441\u043d\u043e\u0432\u0430\u043d\u0438\u0435 \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 \u0442\u0435\u043e\u0440\u0438\u0438 \u0433\u0440\u0430\u0444\u043e\u0432: \u043f\u043e\u0447\u0435\u043c\u0443 DAG-\u0438\u043d\u0432\u0430\u0440\u0438\u0430\u043d\u0442, \u0433\u0440\u0430\u043d\u0438\u0446\u0430 \u0441\u0432\u044f\u0437\u043d\u043e\u0441\u0442\u0438 \u0438 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u043d\u0430\u044f \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u044c \u0438\u043d\u043a\u0440\u0435\u043c\u0435\u043d\u0442\u0430 \u2014 \u044d\u0442\u043e \u043d\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b \u0432 \u0441\u043c\u044b\u0441\u043b\u0435 \u00ab\u0443\u0434\u043e\u0431\u043d\u043e\u00bb, \u0430 \u0435\u0451 \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u0435.\u041f\u043e\u043c\u043d\u0438\u0442\u0435 \u043d\u0430\u0431\u043e\u0440 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u0439 \u0438\u0437 \u0447\u0430\u0441\u0442\u0438 2 \u2014 \u0442\u043e\u0442, \u043f\u043e\u0434 \u0432\u0435\u0441\u043e\u043c \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e AuthService.signUp \u043f\u0440\u0435\u0432\u0440\u0430\u0442\u0438\u043b\u0441\u044f \u0432 god-\u0441\u0435\u0440\u0432\u0438\u0441 \u043d\u0430 \u0432\u043e\u0441\u0435\u043c\u044c\u0441\u043e\u0442 \u0441\u0442\u0440\u043e\u043a, \u043e\u0431\u0440\u043e\u0441\u0448\u0438\u0439 \u0448\u0435\u0441\u0442\u044c\u044e \u0441\u043e\u0441\u0435\u0434\u043d\u0438\u043c\u0438 \u0441\u0435\u0440\u0432\u0438\u0441\u0430\u043c\u0438 \u0438 \u043e\u0434\u043d\u0438\u043c \u043e\u0431\u0440\u0430\u0442\u043d\u044b\u043c forwardRef\u2019\u043e\u043c? \u0422\u043e\u0442 \u0436\u0435 \u0441\u0430\u043c\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a \u0441\u0435\u0439\u0447\u0430\u0441 \u043f\u0440\u0438\u043b\u0435\u0442\u0430\u0435\u0442 \u0432 FBCA-\u043a\u043e\u0434\u043e\u0432\u0443\u044e \u0431\u0430\u0437\u0443:\u043f\u0430\u0440\u0442\u043d\u0451\u0440\u0441\u043a\u0430\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0441 \u0431\u043b\u043e\u0433\u0435\u0440\u0430\u043c\u0438 \u0438 \u0441\u0442\u0440\u0438\u043c\u0435\u0440\u0430\u043c\u0438\u0440\u0430\u0437\u043d\u044b\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 \u043c\u043e\u043d\u0435\u0442\u0438\u0437\u0430\u0446\u0438\u0438 (revenue share, \u0431\u043e\u043d\u0443\u0441\u044b, \u0443\u0440\u043e\u0432\u043d\u0438)\u0431\u043e\u043b\u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u044b\u0439 \u0430\u043d\u0442\u0438-\u0444\u0440\u043e\u0434 (\u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0435\u0432 \u0438 \u0441\u043a\u043e\u0440\u0438\u043d\u0433)\u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u043d\u0430\u044f \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u043a\u0430 (\u043c\u0430\u0440\u043a\u0435\u0442\u0438\u043d\u0433, \u043f\u0440\u043e\u0434\u0443\u043a\u0442, \u0444\u0438\u043d\u0430\u043d\u0441\u044b)\u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0438 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u0440\u0435\u0444\u0435\u0440\u0430\u043b\u043e\u043a\u0411\u0438\u0437\u043d\u0435\u0441-\u043b\u043e\u0433\u0438\u043a\u0430 \u043e\u0431\u044f\u0437\u0430\u043d\u0430 \u043e\u0441\u0442\u0430\u0442\u044c\u0441\u044f \u0442\u043e\u0439 \u0436\u0435 \u2014 \u0438\u043d\u0430\u0447\u0435 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u043d\u0435\u0447\u0435\u0441\u0442\u043d\u043e\u0435. \u0410 \u0432\u043e\u0442 \u0444\u043e\u0440\u043c\u0430 \u043a\u043e\u0434\u0430 \u0438 \u0433\u0440\u0430\u0444\u0430 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u2014 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a \u043e\u043d\u0438 \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u0441\u044f. \u041e\u0433\u043e\u0432\u043e\u0440\u043a\u0430 \u043f\u0440\u043e \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0438 \u0438\u0437 \u0447\u0430\u0441\u0442\u0438 1 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u0442 \u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0437\u0434\u0435\u0441\u044c \u0438 \u0434\u0430\u043b\u0435\u0435 \u2014 \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u043c \u0434\u0435\u043a\u043e\u043c\u043f\u043e\u0437\u0438\u0446\u0438\u044e, \u0430 \u043d\u0435 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u043e\u043d\u043d\u0443\u044e \u0446\u0435\u043b\u043e\u0441\u0442\u043d\u043e\u0441\u0442\u044c.export type SignUpInput = {  email: string;  password: string;  referralCode?: string;  adSourceCode?: string;  ip?: string;  deviceId?: string;};@Injectable()export class SignUpHandler {  constructor(    private readonly bonusExternalService: BonusExternalService,    private readonly usersExternalService: UsersExternalService,    private readonly partnerExternalService: PartnerExternalService,    private readonly adSourceExternalService: AdSourceExternalService,    private readonly referralExternalService: ReferralExternalService,    private readonly analyticsExternalService: AnalyticsExternalService,    private readonly antiFraudExternalService: AntiFraudExternalService,  ) {}  async run(    input: SignUpInput,  ): Promise&lt;Result&lt;SignUpResult, SignUpErrorCode&gt;&gt; {    const { email, password, referralCode, adSourceCode, ip, deviceId } = input;    \/\/ \u0430\u043d\u0442\u0438-\u0444\u0440\u043e\u0434    const checkAntiFraudResult =      await this.antiFraudExternalService.checkSignUp({ ip, deviceId });    if (checkAntiFraudResult.isErr()) {      return err(&#171;SIGN_UP_ANTI_FRAUD_FAILED&#187;);    }    if (!checkAntiFraudResult.value.allowed) {      return err(&#171;SIGN_UP_ANTI_FRAUD_REJECTED&#187;);    }    \/\/ \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c, \u0447\u0442\u043e \u044e\u0437\u0435\u0440 \u0435\u0449\u0451 \u043d\u0435 \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d \u2014 \u0434\u043e \u043b\u044e\u0431\u044b\u0445 side-effect&#8217;\u043e\u0432    const findUserResult =      await this.usersExternalService.getUserByEmail(email);    if (findUserResult.isErr()) {      return err(&#171;SIGN_UP_GET_USER_FAILED&#187;);    }    if (findUserResult.value) {      return err(&#171;SIGN_UP_USER_ALREADY_EXISTS&#187;);    }    \/\/ \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a \u0442\u0440\u0430\u0444\u0438\u043a\u0430 \/ A\/B    const applyAdSourceResult =      await this.adSourceExternalService.applyAdSource(adSourceCode);    if (applyAdSourceResult.isErr()) {      return err(&#171;SIGN_UP_AD_SOURCE_FAILED&#187;);    }    \/\/ \u0440\u0435\u0444\u0435\u0440\u0430\u043b \/ \u043f\u0430\u0440\u0442\u043d\u0451\u0440 (\u043c\u043e\u0434\u0443\u043b\u044c \u0441\u0430\u043c \u0440\u0435\u0448\u0430\u0435\u0442, \u0447\u0442\u043e \u044d\u0442\u043e \u0437\u0430 \u043a\u043e\u0434)    const resolveReferralResult = await this.referralExternalService.resolve(      referralCode,      email,    );    if (resolveReferralResult.isErr()) {      return err(&#171;SIGN_UP_REFERRAL_RESOLVE_FAILED&#187;);    }    const createUserResult = await this.usersExternalService.createUser({      email,      password,      adSource: applyAdSourceResult.value,      ip,      deviceId,    });    if (createUserResult.isErr()) {      return err(&#171;SIGN_UP_CREATE_USER_FAILED&#187;);    }    const referral = resolveReferralResult.value;    const user = createUserResult.value;    \/\/ \u0431\u043e\u043d\u0443\u0441\u044b    if (referral?.kind === &#171;user&#187;) {      const giveReferralBonusResult =        await this.bonusExternalService.giveReferralBonus(referral.ownerId);      if (giveReferralBonusResult.isErr()) {        return err(&#171;SIGN_UP_BONUS_FAILED&#187;);      }      const createReferralResult =        await this.referralExternalService.createReferral(          referral.ownerId,          user.id,        );      if (createReferralResult.isErr()) {        return err(&#171;SIGN_UP_REFERRAL_CREATE_FAILED&#187;);      }    }    if (referral?.kind === &#171;partner&#187;) {      const processPartnerResult =        await this.partnerExternalService.processPartner(referral);      if (processPartnerResult.isErr()) {        return err(&#171;SIGN_UP_PARTNER_FAILED&#187;);      }      const givePartnerRewardResult =        await this.bonusExternalService.givePartnerReward(          processPartnerResult.value,        );      if (givePartnerRewardResult.isErr()) {        return err(&#171;SIGN_UP_PARTNER_REWARD_FAILED&#187;);      }      const trackPartnerRewardResult =        await this.analyticsExternalService.trackPartnerReward(          processPartnerResult.value,        );      if (trackPartnerRewardResult.isErr()) {        return err(&#171;SIGN_UP_ANALYTICS_FAILED&#187;);      }    }    \/\/ \u0444\u0438\u043d\u0430\u043b\u044c\u043d\u0430\u044f \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u043a\u0430    const trackRegistrationResult =      await this.analyticsExternalService.trackRegistration({        userId: user.id,        source: applyAdSourceResult.value?.code,        ip,      });    if (trackRegistrationResult.isErr()) {      return err(&#171;SIGN_UP_ANALYTICS_FAILED&#187;);    }    return ok({ id: user.id, email: user.email });  }}\u041a\u0430\u043a \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043d\u0430\u0431\u043b\u044e\u0434\u0430\u0442\u044c, \u043b\u043e\u0433\u0438\u043a\u0430, \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0438 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u044b \u043e\u0441\u0442\u0430\u043b\u0438\u0441\u044c \u0442\u043e\u0447\u043d\u043e \u0442\u0430\u043a\u0438\u043c\u0438 \u0436\u0435. \u0422\u043e\u0433\u0434\u0430 \u0443 \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u044f \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u044e\u0442 \u043b\u043e\u0433\u0438\u0447\u043d\u044b\u0435 \u0432\u043e\u043f\u0440\u043e\u0441\u044b:\u0417\u0430\u0447\u0435\u043c \u043c\u044b \u0432\u043e\u043e\u0431\u0449\u0435 \u0432\u043d\u0435\u0434\u0440\u044f\u043b\u0438 feature-based-clean, \u0435\u0441\u043b\u0438 \u0431\u0438\u0437\u043d\u0435\u0441-\u043b\u043e\u0433\u0438\u043a\u0430 \u0438\u0434\u0435\u043d\u0442\u0438\u0447\u043d\u0430 FB-\u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0443?\u041a\u043e\u0434\u0430 \u0441\u0442\u0430\u043b\u043e \u0431\u043e\u043b\u044c\u0448\u0435, \u043d\u0435 \u043c\u0435\u043d\u044c\u0448\u0435. \u0413\u0434\u0435 \u043e\u0431\u0435\u0449\u0430\u043d\u043d\u0430\u044f \u0447\u0438\u0442\u0430\u0431\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c?\u0427\u0442\u043e \u044f \u043a\u0430\u043a \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0432\u044b\u0438\u0433\u0440\u044b\u0432\u0430\u044e \u043f\u0440\u044f\u043c\u043e \u0441\u0435\u0439\u0447\u0430\u0441, \u0435\u0441\u043b\u0438 \u0438\u0442\u043e\u0433 \u2014 \u0442\u0435 \u0436\u0435 \u0441\u0430\u043c\u044b\u0435 \u0448\u0430\u0433\u0438, \u0442\u043e\u043b\u044c\u043a\u043e \u0441 \u0431\u043e\u043b\u044c\u0448\u0438\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e\u043c \u043f\u0430\u043f\u043e\u043a \u0438 \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0446\u0438\u0439?\u042d\u0442\u0438 \u0432\u043e\u043f\u0440\u043e\u0441\u044b \u0432\u044b\u0433\u043b\u044f\u0434\u044f\u0442 \u043a\u0430\u043a \u043e\u043f\u0440\u043e\u0432\u0435\u0440\u0436\u0435\u043d\u0438\u0435 \u0432\u0441\u0435\u0439 \u0438\u0434\u0435\u0438. \u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u043e\u043d\u0438 \u043f\u043e\u0434\u0441\u0432\u0435\u0447\u0438\u0432\u0430\u044e\u0442 \u0442\u043e, \u0447\u0442\u043e \u043c\u044b \u0443\u0436\u0435 \u0437\u0430\u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043b\u0438 \u0432 \u0444\u0438\u043d\u0430\u043b\u0435 \u0447\u0430\u0441\u0442\u0438 4: FBCA \u2014 \u044d\u0442\u043e \u043d\u0435 \u043f\u0440\u043e \u0441\u0435\u0433\u043e\u0434\u043d\u044f\u0448\u043d\u0438\u0439 \u043a\u043e\u0434, \u0430 \u043f\u0440\u043e \u043a\u043e\u0434 \u0447\u0435\u0440\u0435\u0437 \u0441\u043f\u0440\u0438\u043d\u0442-\u0434\u0432\u0430-\u0442\u0440\u0438. \u0415\u0441\u043b\u0438 \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u0441\u043d\u0438\u043c\u043e\u043a, FB \u0438 FBCA \u0432\u044b\u0433\u043b\u044f\u0434\u044f\u0442 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u043e \u2014 \u0440\u0430\u0437\u043d\u0438\u0446\u0430 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0443 \u043e\u0434\u043d\u043e\u0433\u043e \u0435\u0441\u0442\u044c \u0442\u043e\u0447\u043a\u0438, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043c\u043e\u0436\u043d\u043e \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c\u0441\u044f, \u0430 \u0443 \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u043d\u0435\u0442. \u042d\u0442\u0430 \u0440\u0430\u0437\u043d\u0438\u0446\u0430 \u043d\u0435 \u0432\u0438\u0434\u043d\u0430, \u043f\u043e\u043a\u0430 \u043d\u0435 \u043f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u043d\u0430\u044f \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0430. \u0418 \u0438\u043c\u0435\u043d\u043d\u043e \u0435\u0451 \u043c\u044b \u0441\u0435\u0439\u0447\u0430\u0441 \u0443\u0432\u0438\u0434\u0438\u043c \u0432 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0438.\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043a\u0430\u043a \u0441 \u0442\u0435\u0447\u0435\u043d\u0438\u0435\u043c \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0440\u0430\u0437\u0432\u0438\u0432\u0430\u043b\u0441\u044f \u043c\u043e\u0434\u0443\u043b\u044c Users \u043f\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u0430\u043c feature-based-clean. \u041f\u043e\u043a\u0430 handler \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u044f \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u043e\u0431\u0440\u0430\u0441\u0442\u0430\u043b \u0432\u043d\u0435\u0448\u043d\u0438\u043c\u0438 \u0441\u0435\u0440\u0432\u0438\u0441\u0430\u043c\u0438, \u0441\u0430\u043c \u043c\u043e\u0434\u0443\u043b\u044c Users \u0442\u043e\u0436\u0435 \u0440\u0430\u0437\u0432\u0438\u0432\u0430\u043b\u0441\u044f \u2014 \u0444\u0440\u043e\u043d\u0442 \u043f\u0440\u043e\u0441\u0438\u043b \u043f\u0440\u043e\u0444\u0438\u043b\u044c, \u043c\u0430\u0440\u043a\u0435\u0442\u0438\u043d\u0433 \u2014 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0443, \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u043a\u0430 \u2014 \u0441\u0447\u0451\u0442\u0447\u0438\u043a\u0438. \u041a \u0442\u0435\u043a\u0443\u0449\u0435\u043c\u0443 \u043c\u043e\u043c\u0435\u043d\u0442\u0443 \u0443 Users \u0443\u0436\u0435 \u043d\u0435 \u0442\u043e\u0442 \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u0439 \u043c\u043e\u0434\u0443\u043b\u044c \u0441 \u0434\u0432\u0443\u043c\u044f use-case\u2019\u0430\u043c\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u043f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043b\u0438 \u0432 \u0447\u0430\u0441\u0442\u0438 4. \u0422\u0435\u043f\u0435\u0440\u044c \u044d\u0442\u043e \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u044b\u0439 \u0434\u043e\u043c\u0435\u043d:\u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0444\u0438\u043b\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0444\u0438\u043b\u044f (bio, avatar, username)\u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a \u0430\u043a\u043a\u0430\u0443\u043d\u0442\u0430\u043f\u0440\u0438\u0432\u0430\u0442\u043d\u043e\u0441\u0442\u044c \u0430\u043a\u043a\u0430\u0443\u043d\u0442\u0430 (public \/ private)\u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0431\u0430\u0437\u043e\u0432\u043e\u0439 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0438 (\u043f\u043e\u0434\u043f\u0438\u0441\u0447\u0438\u043a\u0438, \u043f\u043e\u0434\u043f\u0438\u0441\u043a\u0438)\u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u043c\u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u043c\u0438 (\u044f\u0437\u044b\u043a, \u0442\u0435\u043c\u0430 \u0438 \u0442. \u0434.)\u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f (me endpoint)src\/modules\/users\/\u251c\u2500\u2500 domain\/                           # User, UserProfile, UserSettings, UserPrivacy, &#8230;\u2502\u251c\u2500\u2500 use-case\/\u2502   \u251c\u2500\u2500 presentation\/                 # \u0421\u0446\u0435\u043d\u0430\u0440\u0438\u0438 \u0434\u043b\u044f UsersController\u2502   \u2502   \u251c\u2500\u2500 get-profile\/\u2502   \u2502   \u251c\u2500\u2500 update-profile\/\u2502   \u2502   \u251c\u2500\u2500 update-account-settings\/\u2502   \u2502   \u251c\u2500\u2500 update-privacy\/\u2502   \u2502   \u251c\u2500\u2500 update-preferences\/\u2502   \u2502   \u251c\u2500\u2500 get-user-stats\/\u2502   \u2502   \u2514\u2500\u2500 get-current-user\/\u2502   \u2502\u2502   \u2514\u2500\u2500 external\/                     # \u0421\u0446\u0435\u043d\u0430\u0440\u0438\u0438 \u0434\u043b\u044f \u0434\u0440\u0443\u0433\u0438\u0445 \u043c\u043e\u0434\u0443\u043b\u0435\u0439 (\u0447\u0435\u0440\u0435\u0437 external-\u043f\u043e\u0440\u0442)\u2502       \u251c\u2500\u2500 create-user\/              # \u2190 Auth\u2502       \u251c\u2500\u2500 get-user-by-email\/        # \u2190 Auth\u2502       \u251c\u2500\u2500 check-user-exists\/        # \u2190 Likes, Comments, Follows\u2502       \u251c\u2500\u2500 get-following-ids\/        # \u2190 Feed\u2502       \u251c\u2500\u2500 can-view-content\/         # \u2190 Feed\u2502       \u251c\u2500\u2500 can-receive-notification\/ # \u2190 Notifications\u2502       \u251c\u2500\u2500 get-public-user-info\/     # \u2190 Comments, Likes\u2502       \u251c\u2500\u2500 is-searchable\/            # \u2190 Search\u2502       \u251c\u2500\u2500 is-user-blocked\/          # \u2190 Moderation, AntiFraud\u2502       \u2514\u2500\u2500 get-user-status\/          # \u2190 \u0440\u0430\u0437\u043d\u044b\u0435 \u043c\u043e\u0434\u0443\u043b\u0438\u2502\u251c\u2500\u2500 infrastructure\/\u2502   \u2514\u2500\u2500 repositories\/\u2502       \u251c\u2500\u2500 user\/\u2502       \u251c\u2500\u2500 user-profile\/\u2502       \u251c\u2500\u2500 user-settings\/\u2502       \u251c\u2500\u2500 user-privacy\/\u2502       \u251c\u2500\u2500 user-preferences\/\u2502       \u251c\u2500\u2500 user-stats\/\u2502       \u2514\u2500\u2500 user-session\/\u2502\u251c\u2500\u2500 external\/                         # \u041f\u043e\u0440\u0442 \u0434\u043b\u044f \u0434\u0440\u0443\u0433\u0438\u0445 \u043c\u043e\u0434\u0443\u043b\u0435\u0439 (Auth, Feed, Comments, Search, &#8230;)\u2502\u2514\u2500\u2500 presentation\/                     # UsersController + DTO\u041a\u0430\u043a \u043c\u044b \u0432\u0438\u0434\u0438\u043c, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u0432 \u0431\u043e\u043b\u044c\u0448\u043e\u043c \u0440\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u043d\u0433\u0435 \u00ab\u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043f\u043e \u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0441\u0442\u0438\u00bb \u043e\u0442\u043f\u0430\u043b\u0430. \u0412 feature-based, \u043a\u043e\u0433\u0434\u0430 UsersService \u0434\u043e\u0441\u0442\u0438\u0433\u0430\u0435\u0442 \u043a\u0440\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u043c\u0430\u0441\u0441\u044b \u2014 \u0441\u043a\u0430\u0436\u0435\u043c, \u0432\u043e\u0441\u0435\u043c\u044c\u0441\u043e\u0442 \u0441\u0442\u0440\u043e\u043a \u0438 \u043f\u044f\u0442\u043d\u0430\u0434\u0446\u0430\u0442\u044c \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u043f\u0440\u043e \u0440\u0430\u0437\u043d\u044b\u0435 \u043f\u043e\u0434\u0441\u0438\u0441\u0442\u0435\u043c\u044b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f, \u2014 \u043d\u0430\u0441\u0442\u0443\u043f\u0430\u0435\u0442 \u0432\u0440\u0435\u043c\u044f \u0434\u043b\u044f \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043f\u0435\u0440\u0435\u0434\u0435\u043b\u043a\u0438. \u0420\u0430\u0437\u0434\u0440\u043e\u0431\u0438\u0442\u044c \u043d\u0430 UserProfileService, UserSettingsService, UserPrivacyService. \u042d\u0442\u043e \u0441\u0435\u0440\u044c\u0451\u0437\u043d\u0430\u044f \u0440\u0430\u0431\u043e\u0442\u0430: \u043f\u0435\u0440\u0435\u043f\u0438\u0441\u0430\u0442\u044c \u0432\u044b\u0437\u043e\u0432\u044b, \u0440\u0430\u0437\u0440\u0443\u043b\u0438\u0442\u044c \u0446\u0438\u043a\u043b\u044b, \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u0442\u0435\u0441\u0442\u044b, \u043f\u0435\u0440\u0435\u0441\u043e\u0431\u0440\u0430\u0442\u044c \u043c\u043e\u0434\u0443\u043b\u0438. \u041c\u0435\u0441\u044f\u0446-\u043f\u043e\u043b\u0442\u043e\u0440\u0430 \u043a\u0430\u043a \u043c\u0438\u043d\u0438\u043c\u0443\u043c \u2014 \u0438 \u0432\u0441\u0451 \u044d\u0442\u043e \u0432\u0440\u0435\u043c\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0434\u043e\u043b\u0436\u043d\u0430 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043d\u0430 \u043f\u0440\u043e\u0434\u0435.\u0412 FBCA \u044d\u0442\u043e\u0439 \u0442\u043e\u0447\u043a\u0438 \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0435\u0442. \u041a\u043e\u0433\u0434\u0430 \u043f\u0440\u043e\u0434\u0430\u043a\u0442 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442 \u0441 \u00ab\u043d\u0443\u0436\u043d\u044b \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043f\u0440\u0438\u0432\u0430\u0442\u043d\u043e\u0441\u0442\u0438\u00bb \u2014 \u044d\u0442\u043e use-case\/presentation\/update-privacy\/ \u0440\u044f\u0434\u043e\u043c \u0441 \u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u043c\u0438 update-profile\/ \u0438 update-account-settings\/. \u041a\u043e\u0433\u0434\u0430 DBA \u0433\u043e\u0432\u043e\u0440\u0438\u0442 \u00ab\u0445\u043e\u0440\u043e\u0448\u043e \u0431\u044b \u0432\u044b\u043d\u0435\u0441\u0442\u0438 user_sessions \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0443\u044e \u0442\u0430\u0431\u043b\u0438\u0446\u0443\u00bb \u2014 \u044d\u0442\u043e infrastructure\/repositories\/user-session\/ \u0440\u044f\u0434\u043e\u043c \u0441 user\/ \u0438 user-profile\/. \u041a\u0430\u0436\u0434\u044b\u0439 \u043d\u043e\u0432\u044b\u0439 \u0430\u0440\u0442\u0435\u0444\u0430\u043a\u0442 \u043b\u043e\u0436\u0438\u0442\u0441\u044f \u0440\u044f\u0434\u043e\u043c \u0441\u043e \u0441\u0442\u0430\u0440\u044b\u043c\u0438, \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0441\u0434\u0432\u0438\u0433\u0430\u044f. \u041f\u0430\u043f\u043e\u043a \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u0431\u043e\u043b\u044c\u0448\u0435,&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-480739","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/480739","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=480739"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/480739\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=480739"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=480739"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=480739"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}