-
Notifications
You must be signed in to change notification settings - Fork 348
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
disable aws sdk in checkout calculate taxes
- Loading branch information
1 parent
e18cf17
commit f035283
Showing
6 changed files
with
49 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"app-avatax": patch | ||
--- | ||
|
||
Debugging: Disable importing dynamodb in checkout_calculate_taxes. This will disable logs feature even if flag is enabled |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { ClientLogStoreRequest } from "@/modules/client-logs/client-log"; | ||
import { ILogWriter, LogWriterContext } from "@/modules/client-logs/log-writer"; | ||
import { ILogsRepository } from "@/modules/client-logs/logs-repository"; | ||
|
||
export class DynamoDbLogWriter implements ILogWriter { | ||
constructor( | ||
private repo: ILogsRepository, | ||
private context: LogWriterContext, | ||
) { | ||
if (!repo) { | ||
throw new Error("Repository is nullish"); | ||
} | ||
} | ||
|
||
writeLog = async (log: ClientLogStoreRequest): Promise<void> => { | ||
await this.repo.writeLog({ | ||
appId: this.context.appId, | ||
saleorApiUrl: this.context.saleorApiUrl, | ||
clientLogRequest: log, | ||
}); | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,7 @@ | ||
import { ClientLogStoreRequest } from "@/modules/client-logs/client-log"; | ||
import { ILogsRepository } from "@/modules/client-logs/logs-repository"; | ||
|
||
export type LogWriterContext = { appId: string; saleorApiUrl: string }; | ||
|
||
export interface ILogWriter { | ||
writeLog(log: ClientLogStoreRequest): Promise<void>; | ||
} | ||
|
||
export class DynamoDbLogWriter implements ILogWriter { | ||
constructor( | ||
private repo: ILogsRepository, | ||
private context: LogWriterContext, | ||
) { | ||
if (!repo) { | ||
throw new Error("Repository is nullish"); | ||
} | ||
} | ||
|
||
writeLog = async (log: ClientLogStoreRequest): Promise<void> => { | ||
await this.repo.writeLog({ | ||
appId: this.context.appId, | ||
saleorApiUrl: this.context.saleorApiUrl, | ||
clientLogRequest: log, | ||
}); | ||
}; | ||
} | ||
|
||
/** | ||
* Just no-op. For testing or if feature is disabled | ||
*/ | ||
export class NoopLogWriter implements ILogWriter { | ||
async writeLog(log: ClientLogStoreRequest): Promise<void> { | ||
return; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { ClientLogStoreRequest } from "@/modules/client-logs/client-log"; | ||
import { ILogWriter } from "@/modules/client-logs/log-writer"; | ||
|
||
/** | ||
* Just no-op. For testing or if feature is disabled | ||
*/ | ||
export class NoopLogWriter implements ILogWriter { | ||
async writeLog(log: ClientLogStoreRequest): Promise<void> { | ||
return; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters