17 Commits

Author SHA1 Message Date
5df1d63f80 terraform fixes 2026-04-26 22:15:05 -07:00
108cc204a9 changes 2026-04-26 21:30:27 -07:00
79224fbf13 refactor: remove remaining staging references in app-new configuration 2026-04-24 13:56:18 -07:00
090e5425c6 refactor: rename config file to prod-new.edn 2026-04-24 13:43:50 -07:00
e8c76b8a1a refactor: update nomenclature to app-new for production alternative UI 2026-04-24 13:43:00 -07:00
d03f5674f8 feat: pivot staging environment to production alternative UI 2026-04-24 11:30:44 -07:00
ab3206a82c Merge branch 'staging' into transactions2-with-staging 2026-04-03 07:51:50 -07:00
931a1aa10f merged 2026-03-30 22:40:04 -07:00
297464c188 Merge branch 'master' of codecommit://integreat 2026-03-30 22:38:34 -07:00
6e3a024f66 adds stuff for dough burger 2026-03-30 22:36:12 -07:00
Bryce
28a755e9a9 fixes invoice date filtering 2026-03-02 23:20:14 -08:00
Bryce
01347ff3f5 fixes balance sheet 2026-03-02 22:53:53 -08:00
53625e4583 Makes invoices use the closed_at date. 2026-02-21 22:53:05 -08:00
8899c643ed Complete code review session - documented findings for auto_ap.permissions, iol-ion.query, and auto_ap.ss.admin.background-jobs 2026-02-08 09:31:26 -08:00
c196723913 ok. 2026-02-08 08:43:53 -08:00
395e445c99 Add test for Bonanza Produce invoice 03882095
Validates existing template correctly parses multi-page invoice with:
- Invoice number 03882095
- Customer identifier NICK THE GREEK
- Account number 600 VISTA WAY
- Total of $946.24
2026-02-08 08:40:40 -08:00
a4089836fa merges 2025-10-07 21:54:21 -07:00
21 changed files with 4737 additions and 1442 deletions

3
.gitattributes vendored Normal file
View File

@@ -0,0 +1,3 @@
# Use bd merge for beads JSONL files
.beads/issues.jsonl merge=beads

376
.opencode/package-lock.json generated Normal file
View File

@@ -0,0 +1,376 @@
{
"name": ".opencode",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"dependencies": {
"@opencode-ai/plugin": "1.14.25"
}
},
"node_modules/@msgpackr-extract/msgpackr-extract-darwin-arm64": {
"version": "3.0.3",
"resolved": "https://registry.npmjs.org/@msgpackr-extract/msgpackr-extract-darwin-arm64/-/msgpackr-extract-darwin-arm64-3.0.3.tgz",
"integrity": "sha512-QZHtlVgbAdy2zAqNA9Gu1UpIuI8Xvsd1v8ic6B2pZmeFnFcMWiPLfWXh7TVw4eGEZ/C9TH281KwhVoeQUKbyjw==",
"cpu": [
"arm64"
],
"license": "MIT",
"optional": true,
"os": [
"darwin"
]
},
"node_modules/@msgpackr-extract/msgpackr-extract-darwin-x64": {
"version": "3.0.3",
"resolved": "https://registry.npmjs.org/@msgpackr-extract/msgpackr-extract-darwin-x64/-/msgpackr-extract-darwin-x64-3.0.3.tgz",
"integrity": "sha512-mdzd3AVzYKuUmiWOQ8GNhl64/IoFGol569zNRdkLReh6LRLHOXxU4U8eq0JwaD8iFHdVGqSy4IjFL4reoWCDFw==",
"cpu": [
"x64"
],
"license": "MIT",
"optional": true,
"os": [
"darwin"
]
},
"node_modules/@msgpackr-extract/msgpackr-extract-linux-arm": {
"version": "3.0.3",
"resolved": "https://registry.npmjs.org/@msgpackr-extract/msgpackr-extract-linux-arm/-/msgpackr-extract-linux-arm-3.0.3.tgz",
"integrity": "sha512-fg0uy/dG/nZEXfYilKoRe7yALaNmHoYeIoJuJ7KJ+YyU2bvY8vPv27f7UKhGRpY6euFYqEVhxCFZgAUNQBM3nw==",
"cpu": [
"arm"
],
"license": "MIT",
"optional": true,
"os": [
"linux"
]
},
"node_modules/@msgpackr-extract/msgpackr-extract-linux-arm64": {
"version": "3.0.3",
"resolved": "https://registry.npmjs.org/@msgpackr-extract/msgpackr-extract-linux-arm64/-/msgpackr-extract-linux-arm64-3.0.3.tgz",
"integrity": "sha512-YxQL+ax0XqBJDZiKimS2XQaf+2wDGVa1enVRGzEvLLVFeqa5kx2bWbtcSXgsxjQB7nRqqIGFIcLteF/sHeVtQg==",
"cpu": [
"arm64"
],
"license": "MIT",
"optional": true,
"os": [
"linux"
]
},
"node_modules/@msgpackr-extract/msgpackr-extract-linux-x64": {
"version": "3.0.3",
"resolved": "https://registry.npmjs.org/@msgpackr-extract/msgpackr-extract-linux-x64/-/msgpackr-extract-linux-x64-3.0.3.tgz",
"integrity": "sha512-cvwNfbP07pKUfq1uH+S6KJ7dT9K8WOE4ZiAcsrSes+UY55E/0jLYc+vq+DO7jlmqRb5zAggExKm0H7O/CBaesg==",
"cpu": [
"x64"
],
"license": "MIT",
"optional": true,
"os": [
"linux"
]
},
"node_modules/@msgpackr-extract/msgpackr-extract-win32-x64": {
"version": "3.0.3",
"resolved": "https://registry.npmjs.org/@msgpackr-extract/msgpackr-extract-win32-x64/-/msgpackr-extract-win32-x64-3.0.3.tgz",
"integrity": "sha512-x0fWaQtYp4E6sktbsdAqnehxDgEc/VwM7uLsRCYWaiGu0ykYdZPiS8zCWdnjHwyiumousxfBm4SO31eXqwEZhQ==",
"cpu": [
"x64"
],
"license": "MIT",
"optional": true,
"os": [
"win32"
]
},
"node_modules/@opencode-ai/plugin": {
"version": "1.14.25",
"resolved": "https://registry.npmjs.org/@opencode-ai/plugin/-/plugin-1.14.25.tgz",
"integrity": "sha512-Mvx8R9MFLFSJBHkcleAdRcdCW+ADiOKgzF89h80ywgsnRgwQEjVQjkCL+veyXjyiyvsai2S/qLNg6etlQRhfUw==",
"license": "MIT",
"dependencies": {
"@opencode-ai/sdk": "1.14.25",
"effect": "4.0.0-beta.48",
"zod": "4.1.8"
},
"peerDependencies": {
"@opentui/core": ">=0.1.103",
"@opentui/solid": ">=0.1.103"
},
"peerDependenciesMeta": {
"@opentui/core": {
"optional": true
},
"@opentui/solid": {
"optional": true
}
}
},
"node_modules/@opencode-ai/sdk": {
"version": "1.14.25",
"resolved": "https://registry.npmjs.org/@opencode-ai/sdk/-/sdk-1.14.25.tgz",
"integrity": "sha512-YSb+77OgIylwnk9aLoIyfr7FOx3MDD1ASEy2cUbOGTnhNqcR7S2sZAWLgkNWBBOkIH4tG6ouOckcG8lg12a3Tg==",
"license": "MIT",
"dependencies": {
"cross-spawn": "7.0.6"
}
},
"node_modules/@standard-schema/spec": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/@standard-schema/spec/-/spec-1.1.0.tgz",
"integrity": "sha512-l2aFy5jALhniG5HgqrD6jXLi/rUWrKvqN/qJx6yoJsgKhblVd+iqqU4RCXavm/jPityDo5TCvKMnpjKnOriy0w==",
"license": "MIT"
},
"node_modules/cross-spawn": {
"version": "7.0.6",
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz",
"integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==",
"license": "MIT",
"dependencies": {
"path-key": "^3.1.0",
"shebang-command": "^2.0.0",
"which": "^2.0.1"
},
"engines": {
"node": ">= 8"
}
},
"node_modules/detect-libc": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz",
"integrity": "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==",
"license": "Apache-2.0",
"optional": true,
"engines": {
"node": ">=8"
}
},
"node_modules/effect": {
"version": "4.0.0-beta.48",
"resolved": "https://registry.npmjs.org/effect/-/effect-4.0.0-beta.48.tgz",
"integrity": "sha512-MMAM/ZabuNdNmgXiin+BAanQXK7qM8mlt7nfXDoJ/Gn9V8i89JlCq+2N0AiWmqFLXjGLA0u3FjiOjSOYQk5uMw==",
"license": "MIT",
"dependencies": {
"@standard-schema/spec": "^1.1.0",
"fast-check": "^4.6.0",
"find-my-way-ts": "^0.1.6",
"ini": "^6.0.0",
"kubernetes-types": "^1.30.0",
"msgpackr": "^1.11.9",
"multipasta": "^0.2.7",
"toml": "^4.1.1",
"uuid": "^13.0.0",
"yaml": "^2.8.3"
}
},
"node_modules/fast-check": {
"version": "4.7.0",
"resolved": "https://registry.npmjs.org/fast-check/-/fast-check-4.7.0.tgz",
"integrity": "sha512-NsZRtqvSSoCP0HbNjUD+r1JH8zqZalyp6gLY9e7OYs7NK9b6AHOs2baBFeBG7bVNsuoukh89x2Yg3rPsul8ziQ==",
"funding": [
{
"type": "individual",
"url": "https://github.com/sponsors/dubzzz"
},
{
"type": "opencollective",
"url": "https://opencollective.com/fast-check"
}
],
"license": "MIT",
"dependencies": {
"pure-rand": "^8.0.0"
},
"engines": {
"node": ">=12.17.0"
}
},
"node_modules/find-my-way-ts": {
"version": "0.1.6",
"resolved": "https://registry.npmjs.org/find-my-way-ts/-/find-my-way-ts-0.1.6.tgz",
"integrity": "sha512-a85L9ZoXtNAey3Y6Z+eBWW658kO/MwR7zIafkIUPUMf3isZG0NCs2pjW2wtjxAKuJPxMAsHUIP4ZPGv0o5gyTA==",
"license": "MIT"
},
"node_modules/ini": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/ini/-/ini-6.0.0.tgz",
"integrity": "sha512-IBTdIkzZNOpqm7q3dRqJvMaldXjDHWkEDfrwGEQTs5eaQMWV+djAhR+wahyNNMAa+qpbDUhBMVt4ZKNwpPm7xQ==",
"license": "ISC",
"engines": {
"node": "^20.17.0 || >=22.9.0"
}
},
"node_modules/isexe": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",
"integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==",
"license": "ISC"
},
"node_modules/kubernetes-types": {
"version": "1.30.0",
"resolved": "https://registry.npmjs.org/kubernetes-types/-/kubernetes-types-1.30.0.tgz",
"integrity": "sha512-Dew1okvhM/SQcIa2rcgujNndZwU8VnSapDgdxlYoB84ZlpAD43U6KLAFqYo17ykSFGHNPrg0qry0bP+GJd9v7Q==",
"license": "Apache-2.0"
},
"node_modules/msgpackr": {
"version": "1.11.10",
"resolved": "https://registry.npmjs.org/msgpackr/-/msgpackr-1.11.10.tgz",
"integrity": "sha512-iCZNq+HszvF+fC3anCm4nBmWEnbeIAfpDs6IStAEKhQ2YSgkjzVG2FF9XJqwwQh5bH3N9OUTUt4QwVN6MLMLtA==",
"license": "MIT",
"optionalDependencies": {
"msgpackr-extract": "^3.0.2"
}
},
"node_modules/msgpackr-extract": {
"version": "3.0.3",
"resolved": "https://registry.npmjs.org/msgpackr-extract/-/msgpackr-extract-3.0.3.tgz",
"integrity": "sha512-P0efT1C9jIdVRefqjzOQ9Xml57zpOXnIuS+csaB4MdZbTdmGDLo8XhzBG1N7aO11gKDDkJvBLULeFTo46wwreA==",
"hasInstallScript": true,
"license": "MIT",
"optional": true,
"dependencies": {
"node-gyp-build-optional-packages": "5.2.2"
},
"bin": {
"download-msgpackr-prebuilds": "bin/download-prebuilds.js"
},
"optionalDependencies": {
"@msgpackr-extract/msgpackr-extract-darwin-arm64": "3.0.3",
"@msgpackr-extract/msgpackr-extract-darwin-x64": "3.0.3",
"@msgpackr-extract/msgpackr-extract-linux-arm": "3.0.3",
"@msgpackr-extract/msgpackr-extract-linux-arm64": "3.0.3",
"@msgpackr-extract/msgpackr-extract-linux-x64": "3.0.3",
"@msgpackr-extract/msgpackr-extract-win32-x64": "3.0.3"
}
},
"node_modules/multipasta": {
"version": "0.2.7",
"resolved": "https://registry.npmjs.org/multipasta/-/multipasta-0.2.7.tgz",
"integrity": "sha512-KPA58d68KgGil15oDqXjkUBEBYc00XvbPj5/X+dyzeo/lWm9Nc25pQRlf1D+gv4OpK7NM0J1odrbu9JNNGvynA==",
"license": "MIT"
},
"node_modules/node-gyp-build-optional-packages": {
"version": "5.2.2",
"resolved": "https://registry.npmjs.org/node-gyp-build-optional-packages/-/node-gyp-build-optional-packages-5.2.2.tgz",
"integrity": "sha512-s+w+rBWnpTMwSFbaE0UXsRlg7hU4FjekKU4eyAih5T8nJuNZT1nNsskXpxmeqSK9UzkBl6UgRlnKc8hz8IEqOw==",
"license": "MIT",
"optional": true,
"dependencies": {
"detect-libc": "^2.0.1"
},
"bin": {
"node-gyp-build-optional-packages": "bin.js",
"node-gyp-build-optional-packages-optional": "optional.js",
"node-gyp-build-optional-packages-test": "build-test.js"
}
},
"node_modules/path-key": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz",
"integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==",
"license": "MIT",
"engines": {
"node": ">=8"
}
},
"node_modules/pure-rand": {
"version": "8.4.0",
"resolved": "https://registry.npmjs.org/pure-rand/-/pure-rand-8.4.0.tgz",
"integrity": "sha512-IoM8YF/jY0hiugFo/wOWqfmarlE6J0wc6fDK1PhftMk7MGhVZl88sZimmqBBFomLOCSmcCCpsfj7wXASCpvK9A==",
"funding": [
{
"type": "individual",
"url": "https://github.com/sponsors/dubzzz"
},
{
"type": "opencollective",
"url": "https://opencollective.com/fast-check"
}
],
"license": "MIT"
},
"node_modules/shebang-command": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz",
"integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==",
"license": "MIT",
"dependencies": {
"shebang-regex": "^3.0.0"
},
"engines": {
"node": ">=8"
}
},
"node_modules/shebang-regex": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz",
"integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==",
"license": "MIT",
"engines": {
"node": ">=8"
}
},
"node_modules/toml": {
"version": "4.1.1",
"resolved": "https://registry.npmjs.org/toml/-/toml-4.1.1.tgz",
"integrity": "sha512-EBJnVBr3dTXdA89WVFoAIPUqkBjxPMwRqsfuo1r240tKFHXv3zgca4+NJib/h6TyvGF7vOawz0jGuryJCdNHrw==",
"license": "MIT",
"engines": {
"node": ">=20"
}
},
"node_modules/uuid": {
"version": "13.0.0",
"resolved": "https://registry.npmjs.org/uuid/-/uuid-13.0.0.tgz",
"integrity": "sha512-XQegIaBTVUjSHliKqcnFqYypAd4S+WCYt5NIeRs6w/UAry7z8Y9j5ZwRRL4kzq9U3sD6v+85er9FvkEaBpji2w==",
"funding": [
"https://github.com/sponsors/broofa",
"https://github.com/sponsors/ctavan"
],
"license": "MIT",
"bin": {
"uuid": "dist-node/bin/uuid"
}
},
"node_modules/which": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
"integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==",
"license": "ISC",
"dependencies": {
"isexe": "^2.0.0"
},
"bin": {
"node-which": "bin/node-which"
},
"engines": {
"node": ">= 8"
}
},
"node_modules/yaml": {
"version": "2.8.3",
"resolved": "https://registry.npmjs.org/yaml/-/yaml-2.8.3.tgz",
"integrity": "sha512-AvbaCLOO2Otw/lW5bmh9d/WEdcDFdQp2Z2ZUH3pX9U2ihyUY0nvLv7J6TrWowklRGPYbB/IuIMfYgxaCPg5Bpg==",
"license": "ISC",
"bin": {
"yaml": "bin.mjs"
},
"engines": {
"node": ">= 14.6"
},
"funding": {
"url": "https://github.com/sponsors/eemeli"
}
},
"node_modules/zod": {
"version": "4.1.8",
"license": "MIT",
"funding": {
"url": "https://github.com/sponsors/colinhacks"
}
}
}
}

36
config/prod-new.edn Normal file
View File

@@ -0,0 +1,36 @@
{:db {:server "database"}
:datomic-url "datomic:ddb://us-east-1/integreat/integreat-prod"
:base-url "https://new.app.integreatconsult.com"
:solr-uri "http://solr-ec2-prod.local:8983"
:solr-impl :solr
:scheme "https"
:dd-env "prod"
:dd-service "integreat-app"
:jwt-secret "auto ap invoices are awesome"
:invoice-import-queue-url "https://sqs.us-east-1.amazonaws.com/679918342773/integreat-mail-prod"
:requests-queue-url "https://sqs.us-east-1.amazonaws.com/679918342773/integreat-background-request-prod"
:invoice-email "invoices@mail.app.integreatconsult.com"
:import-failure-destination-email "ben@integreatconsult.com"
:data-bucket "data.app-new.app.integreatconsult.com"
:yodlee-cobrand-name "qstartus12"
:yodlee-cobrand-login "qstartus12"
:yodlee-cobrand-password "MPD@mg78hd"
:yodlee-user-login "integreat"
:yodlee-user-password "Import3transactions!"
:yodlee-base-url "https://quickstart2.api.yodlee.com/ysl"
:yodlee-app "10003600"
:yodlee-fastlink "https://quickstartus2node.yodleeinteractive.com/authenticate/qstartus12/?channelAppName=quickstartus2"
:yodlee-proxy-host "172.31.10.83"
:yodlee-proxy-port 8888
:run-background? false
:run-web? true
:yodlee2-integreat-user "integreat-main"
:yodlee2-client-id "3AATcwfPsWP1rP9oDoo4HvZhtaroGVcA"
:yodlee2-client-secret "cXTBmKbGfkaBFIpM"
:yodlee2-base-url "https://production.api.yodlee.com/ysl"
:yodlee2-fastlink "https://fl4.prod.yodlee.com/authenticate/USDevexProd2-319/fastlink/?channelAppName=usdevexprod2"
:yodlee2-proxy-host "172.31.10.83"
:yodlee2-proxy-port 8888
:plaid {:base-url "https://production.plaid.com"
:client-id "61bfab05f7e762001b323f79"
:secret-key "2be026ca5e7f7e9f23f2fb4d7c914d"}}

Binary file not shown.

View File

@@ -293,7 +293,9 @@
(condp = (:name (:source order))
"GRUBHUB" :ccp-processor/grubhub
"UBEREATS" :ccp-processor/uber-eats
"Uber Eats" :ccp-processor/uber-eats
"DOORDASH" :ccp-processor/doordash
"DoorDash" :ccp-processor/doordash
"Koala" :ccp-processor/koala
"koala-production" :ccp-processor/koala
:ccp-processor/na))
@@ -349,7 +351,10 @@
(s/reduce conj []))]
[(remove-nils
#:sales-order
{:date (coerce/to-date (time/to-time-zone (coerce/to-date-time (:created_at order)) (time/time-zone-for-id "America/Los_Angeles")))
{:date (if (= "Invoices" (:name (:source order)))
(when (:closed_at order)
(coerce/to-date (time/to-time-zone (coerce/to-date-time (:closed_at order)) (time/time-zone-for-id "America/Los_Angeles"))))
(coerce/to-date (time/to-time-zone (coerce/to-date-time (:created_at order)) (time/time-zone-for-id "America/Los_Angeles"))))
:client (:db/id client)
:location (:square-location/client-location location)
:external-id (str "square/order/" (:client/code client) "-" (:square-location/client-location location) "-" (:id order))
@@ -379,6 +384,9 @@
;; sometimes orders stay open in square. At least one payment
;; is needed to import, in order to avoid importing orders in-progress.
(and
(if (= "Invoices" (:name (:source order)))
(boolean (:closed_at order))
true)
(or (> (count (:tenders order)) 0)
(seq (:returns order)))
(or (= #{} (set (map #(:status (:card_details %)) (:tenders order))))
@@ -862,7 +870,11 @@
#_(comment
(require 'auto-ap.time-reader)
@(let [[c [l]] (get-square-client-and-location "DBFS") ]
(log/peek :x [ c l])
(search c l #clj-time/date-time "2026-03-28" #clj-time/date-time "2026-03-29")
)
@(let [[c [l]] (get-square-client-and-location "NGAK") ]
(log/peek :x [ c l])
@@ -972,13 +984,14 @@
:headers (client-base-headers client)
:as :json})
:body)))
(->>
@(let [[c [l]] (get-square-client-and-location "NGGG")]
(->>
@(let [[c [l]] (get-square-client-and-location "NGGG")]
(search c l (time/plus (time/now))))
(filter (fn [r]
(str/starts-with? (:created_at r) "2024-03-14"))))
(search c l (time/now) (time/plus (time/now) (time/days -1))))
(filter (fn [r]
(str/starts-with? (:created_at r) "2024-03-14"))))
(def refs
(->>
@@ -995,35 +1008,35 @@
(map (fn [r] @(get-payment c (:payment_id r))) refs))
(get-square-client-and-location "NGGB")
(get-square-client-and-location "NGGB")
(def my-results
(let [[c [l]] (get-square-client-and-location "NGFA")]))
(clojure.data.csv/write-csv *out*
(for [c (get-square-clients)
l (:client/square-locations c)
:when (:square-location/client-location l)
bad-row (try (->> @(search c l (coerce/to-date-time #inst "2024-04-01T00:00:00-07:00") (coerce/to-date-time #inst "2024-04-15T23:59:00-07:00"))
(filter #(not (should-import-order? %)))
(map #(first (deref (order->sales-order c l %))))
(filter (fn already-exists [o]
(when (:sales-order/external-id o)
(seq (dc/q '[:find ?i
:in $ ?ei
:where [?i :sales-order/external-id ?ei]]
(dc/db conn)
(:sales-order/external-id o)))))))
(catch Exception e
[]))]
[(:client/code c) (atime/unparse-local (clj-time.coerce/to-date-time (:sales-order/date bad-row)) atime/normal-date) (:sales-order/total bad-row) (:sales-order/tax bad-row) (:sales-order/tip bad-row) (:db/id bad-row)])
:separator \tab)
(for [c (get-square-clients)
l (:client/square-locations c)
:when (:square-location/client-location l)
bad-row (try (->> @(search c l (coerce/to-date-time #inst "2024-04-01T00:00:00-07:00") (coerce/to-date-time #inst "2024-04-15T23:59:00-07:00"))
(filter #(not (should-import-order? %)))
(map #(first (deref (order->sales-order c l %))))
(filter (fn already-exists [o]
(when (:sales-order/external-id o)
(seq (dc/q '[:find ?i
:in $ ?ei
:where [?i :sales-order/external-id ?ei]]
(dc/db conn)
(:sales-order/external-id o)))))))
(catch Exception e
[]))]
[(:client/code c) (atime/unparse-local (clj-time.coerce/to-date-time (:sales-order/date bad-row)) atime/normal-date) (:sales-order/total bad-row) (:sales-order/tax bad-row) (:sales-order/tip bad-row) (:db/id bad-row)])
:separator \tab)
;; =>
(require 'auto-ap.time-reader)
@@ -1035,7 +1048,7 @@
(def z @(search c l #clj-time/date-time "2025-02-23T00:00:00-08:00"
#clj-time/date-time "2025-02-28T00:00:00-08:00"))
#clj-time/date-time "2025-02-28T00:00:00-08:00"))
(take 10 (map #(first (deref (order->sales-order c l %))) z)))
@@ -1051,17 +1064,43 @@
(count)
)
(doseq [c (get-square-clients)]
(println "Upserting" (:client/name c))
@(upsert c))
(doseq [[code] (seq (dc/q '[:find ?code
:in $
:where [?o :sales-order/date ?d]
[(>= ?d #inst "2026-01-01")]
[?o :sales-order/source "Invoices"]
[?o :sales-order/client ?c]
[?c :client/code ?code]]
(dc/db conn)))
:let [[c [l]] (get-square-client-and-location code)
]
order @(search c l #clj-time/date-time "2026-01-01T00:00:00-08:00" (time/now))
:when (= "Invoices" (:name (:source order) ))
:let [[sales-order] @(order->sales-order c l order)]]
(when (should-import-order? order)
(println "DATE IS" (:sales-order/date sales-order))
(when (some-> (:sales-order/date sales-order) coerce/to-date-time (time/after? #clj-time/date-time "2026-2-16T00:00:00-08:00"))
(println "WOULD UPDATE" sales-order)
@(dc/transact auto-ap.datomic/conn [sales-order])
)
#_@(dc/transact )
(println "DONE"))
)
#_(filter (comp #{"OTHER"} :type) (mapcat :tenders z))
(let [[c [l]] (get-square-client-and-location "LFHH")]
(search c l (clj-time.coerce/from-date #inst "2025-02-28") (clj-time.coerce/from-date #inst "2025-03-01"))
@(let [[c [l]] (get-square-client-and-location "NGRY")]
#_(search c l (clj-time.coerce/from-date #inst "2025-02-28") (clj-time.coerce/from-date #inst "2025-03-01"))
(:order (get-order c l "CLjQqkzVfGa82o5hEFUrGtUGO6QZY" ))
)
(order->sales-order c l (:order (get-order c l "KdvwntmfMNTKBu8NOocbxatOs18YY" )))
)
)

View File

@@ -1,11 +1,13 @@
(ns auto-ap.ssr.components.date-range
(:require [auto-ap.ssr.components :as com]
[auto-ap.ssr.components.buttons :as but]
[auto-ap.ssr.svg :as svg]
[auto-ap.time :as atime]
[clj-time.coerce :as c]
[clj-time.core :as t]
[clj-time.periodic :as per]))
(defn date-range-field [{:keys [value id]}]
(defn date-range-field [{:keys [value id apply-button?]}]
[:div {:id id}
(com/field {:label "Date Range"}
[:div.space-y-4
@@ -21,11 +23,17 @@
(atime/unparse-local atime/normal-date))
:placeholder "Date"
:size :small
:class "shrink"})
:class "shrink date-filter-input"})
(com/date-input {:name "end-date"
:value (some-> (:end value)
(atime/unparse-local atime/normal-date))
:placeholder "Date"
:size :small
:class "shrink"})]])])
:class "shrink date-filter-input"})
(when apply-button?
(but/button- {:color :secondary
:size :small
:type "button"
"x-on:click" "$dispatch('datesApplied')"}
"Apply"))]])])

View File

@@ -38,7 +38,7 @@
[auto-ap.ssr.invoice.common :refer [default-read]]
[auto-ap.ssr.invoice.import :as invoice-import]
[auto-ap.ssr.invoice.new-invoice-wizard :as new-invoice-wizard :refer [location-select*]]
[auto-ap.ssr.pos.common :refer [date-range-field*]]
[auto-ap.ssr.components.date-range :as dr]
[auto-ap.ssr.svg :as svg]
[auto-ap.ssr.utils
:refer [apply-middleware-to-all-handlers assert-schema
@@ -78,7 +78,7 @@
[:div {:id "exact-match-id-tag"}]))
(defn filters [request]
[:form#invoice-filters {"hx-trigger" "change delay:500ms, keyup changed from:.hot-filter delay:1000ms"
[:form#invoice-filters {"hx-trigger" "datesApplied, change delay:500ms from:.filter-trigger, keyup changed from:.hot-filter delay:1000ms"
"hx-get" (bidi/path-for ssr-routes/only-routes
::route/table)
"hx-target" "#entity-table"
@@ -93,7 +93,8 @@
:url (bidi/path-for ssr-routes/only-routes :vendor-search)
:value (:vendor (:query-params request))
:value-fn :db/id
:content-fn :vendor/name}))
:content-fn :vendor/name
:class "filter-trigger"}))
(com/field {:label "Account"}
(com/typeahead {:name "account"
:id "account"
@@ -101,8 +102,12 @@
:value (:account (:query-params request))
:value-fn :db/id
:content-fn #(:account/name (d-accounts/clientize (dc/pull (dc/db conn) d-accounts/default-read (:db/id %))
(:db/id (:client request))))}))
(date-range-field* request)
(:db/id (:client request))))
:class "filter-trigger"}))
(dr/date-range-field {:value {:start (:start-date (:query-params request))
:end (:end-date (:query-params request))}
:id "date-range"
:apply-button? true})
(com/field {:label "Check #"}
(com/text-input {:name "check-number"
:id "check-number"
@@ -487,7 +492,10 @@
:fetch-page fetch-page
:oob-render
(fn [request]
[(assoc-in (date-range-field* request) [1 :hx-swap-oob] true)
[(assoc-in (dr/date-range-field {:value {:start (:start-date (:query-params request))
:end (:end-date (:query-params request))}
:id "date-range"
:apply-button? true}) [1 :hx-swap-oob] true)
(assoc-in (exact-match-id* request) [1 :hx-swap-oob] true)])
:query-schema query-schema
:parse-query-params (fn [p]

View File

@@ -81,7 +81,7 @@
data (into []
(for [client-id client-ids
d date
[client-id account-id location debits credits balance count] (iol-ion.query/detailed-account-snapshot (dc/db conn) client-id (coerce/to-date (time/plus d (time/days 1))))
[client-id account-id location debits credits balance count] (iol-ion.query/detailed-account-snapshot (dc/db conn) client-id (coerce/to-date d))
:let [account ((or (lookup-account client-id) {}) account-id)]]
{:client-id client-id
:account-id account-id

View File

@@ -3,11 +3,11 @@
"environment": [
{
"name": "config",
"value": "/usr/local/config/staging.edn"
"value": "/usr/local/config/prod-new.edn"
},
{
"name": "DD_ENV",
"value": "staging"
"value": "app-new"
},
{
"name": "DD_SERVICE",
@@ -15,17 +15,17 @@
}
],
"essential": true,
"image": "679918342773.dkr.ecr.us-east-1.amazonaws.com/integreat:staging",
"image": "679918342773.dkr.ecr.us-east-1.amazonaws.com/integreat-cloud:prod",
"logConfiguration": {
"logDriver": "awslogs",
"options": {
"awslogs-group": "/ecs/integreat-app-staging",
"awslogs-group": "/ecs/integreat-app-new",
"awslogs-region": "us-east-1",
"awslogs-stream-prefix": "ecs"
}
},
"dockerLabels": {
"com.datadoghq.tags.env": "staging",
"com.datadoghq.tags.env": "app-new",
"com.datadoghq.tags.service": "integreat-app"
},
"mountPoints": [],

View File

@@ -1,9 +1,9 @@
aws_access_key_id="AKIAINHACMVQJ6NYD26A"
aws_secret_access_key="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"
domain="staging3.app.integreatconsult.com"
invoice_address="invoices-staging@mail.app.integreatconsult.com"
base_url="https://staging3.app.integreatconsult.com"
stage="staging"
domain="new.app.integreatconsult.com"
invoice_address="invoices-new@mail.app.integreatconsult.com"
base_url="https://new.app.integreatconsult.com"
stage="app-new"
task_role_arn="arn:aws:iam::679918342773:role/datomic-ddb"
execution_role_arn="arn:aws:iam::679918342773:role/ecsTaskExecutionRole"
ecs_cluster="arn:aws:ecs:us-east-1:679918342773:cluster/default"
@@ -12,3 +12,4 @@ local_namespace="ns-gv2z744em7myo2jp"
desired_count=1
background_desired_count=0
enable_schedules=false
enable_solr=false

View File

@@ -9,6 +9,11 @@ variable "enable_schedules" {
default = null
}
variable "enable_solr" {
type = bool
default = false
}
variable "http_listener_sg" {
default = "sg-0024906e0e1f78048"
}

View File

@@ -11,3 +11,5 @@ ecs_cluster="arn:aws:ecs:us-east-1:679918342773:cluster/default"
local_namespace="ns-gv2z744em7myo2jp"
desired_count=2
background_desired_count=1
enable_schedules=true
enable_solr=true

View File

@@ -12,3 +12,4 @@ local_namespace="ns-gv2z744em7myo2jp"
desired_count=2
background_desired_count=1
enable_schedules=true
enable_solr=true

View File

@@ -1,97 +1,8 @@
resource "aws_efs_file_system" "solr_storage" {
count = var.enable_solr ? 1 : 0
creation_token = "solr_storage-${var.stage}"
tags = {
Name = "solr_storage_${var.stage}"
}
}
resource "aws_ecs_task_definition" "solr" {
family = "solr_${var.stage}"
container_definitions = file("${var.stage}-solr-taskdef.json")
memory = 4096
cpu = 1024
network_mode = "awsvpc"
requires_compatibilities = ["FARGATE"]
execution_role_arn = var.execution_role_arn
task_role_arn = var.task_role_arn
volume {
name = "solr-storage"
efs_volume_configuration {
file_system_id = aws_efs_file_system.solr_storage.id
root_directory = "/"
/*
authorization_config {
access_point_id = aws_efs_access_point.test.id
iam = "ENABLED"
}
*/
}
}
}
resource "aws_ecs_service" "solr" {
name = "solr_app_${var.stage}"
cluster = var.ecs_cluster
task_definition = aws_ecs_task_definition.solr.arn
desired_count = 1
deployment_controller {
type = "ECS"
}
scheduling_strategy = "REPLICA"
platform_version = "LATEST"
network_configuration {
assign_public_ip = true
security_groups = [ "sg-004e5855310c453a3", "sg-02d167406b1082698"]
subnets = [ "subnet-5e675761", "subnet-8519fde2", "subnet-89bab8d4" ]
}
service_registries {
container_port = 0
port = 0
registry_arn = aws_service_discovery_service.solr.arn
}
capacity_provider_strategy {
base = 1
capacity_provider = "FARGATE"
weight = 5
}
deployment_circuit_breaker {
enable = false
rollback = false
}
wait_for_steady_state = true
timeouts {}
lifecycle {
ignore_changes = [task_definition]
}
}
resource "aws_service_discovery_service" "solr" {
name = "solr-${var.stage}"
dns_config {
namespace_id = var.local_namespace
dns_records {
ttl = 10
type = "A"
}
routing_policy = "MULTIVALUE"
}
health_check_custom_config {
failure_threshold = 1
}
}

View File

@@ -1,5 +1,6 @@
resource "aws_instance" "solr_ec2" {
ami = data.aws_ami.amazon_linux_2023.id
count = var.enable_solr ? 1 : 0
ami = "ami-0fea1219385942eb5"
instance_type = "m7g.large"
key_name = "http-proxy"
@@ -34,7 +35,8 @@ filter {
}
resource "aws_ebs_volume" "solr_ec2_storage" {
availability_zone = aws_instance.solr_ec2.availability_zone
count = var.enable_solr ? 1 : 0
availability_zone = aws_instance.solr_ec2[0].availability_zone
size = 30 # Size of the EBS volume in GB.
tags = {
@@ -43,22 +45,24 @@ resource "aws_ebs_volume" "solr_ec2_storage" {
}
resource "aws_volume_attachment" "attach_solr_storage" {
count = var.enable_solr ? 1 : 0
device_name = "/dev/xvdf" # Choose a suitable device name based on your needs.
instance_id = aws_instance.solr_ec2.id
volume_id = aws_ebs_volume.solr_ec2_storage.id
instance_id = aws_instance.solr_ec2[0].id
volume_id = aws_ebs_volume.solr_ec2_storage[0].id
#wait_for detachment_timeout = "30m"
#wait for detachment_timeout = "30m"
}
# You may need to add additional resources such as IAM roles, security groups configuration, etc.,
# depending on what services or actions your Solr needs access to.
output "ec2_public_ip" {
value = aws_instance.solr_ec2.public_ip
value = var.enable_solr ? aws_instance.solr_ec2[0].public_ip : ""
}
resource "aws_service_discovery_service" "solr_ec2" {
count = var.enable_solr ? 1 : 0
name = "solr-ec2-${var.stage}"
dns_config {
@@ -77,11 +81,12 @@ resource "aws_service_discovery_service" "solr_ec2" {
}
resource "aws_service_discovery_instance" "solr_instance" {
service_id = aws_service_discovery_service.solr_ec2.id
count = var.enable_solr ? 1 : 0
service_id = aws_service_discovery_service.solr_ec2[0].id
instance_id = "solr-ec2"
attributes = {
"AWS_INSTANCE_IPV4" = aws_instance.solr_ec2.private_ip
"AWS_INSTANCE_IPV4" = aws_instance.solr_ec2[0].private_ip
}
depends_on = [

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,997 @@
{
"version": 4,
"terraform_version": "1.14.9",
"serial": 284,
"lineage": "91d10fe0-8033-8778-c202-78d5a81632e8",
"outputs": {
"aws_access_key_id": {
"value": "AKIAZ4TSKSJ2VGEYT3KL",
"type": "string",
"sensitive": true
},
"aws_default_region": {
"value": "us-east-1",
"type": "string"
},
"aws_secret_access_key": {
"value": "G47l1ZO+LsqarmspEj2GNAGprJb6kcSMIZRpLtAe",
"type": "string",
"sensitive": true
},
"ec2_public_ip": {
"value": "",
"type": "string"
},
"queue_url": {
"value": "https://sqs.us-east-1.amazonaws.com/679918342773/integreat-mail-staging",
"type": "string"
}
},
"resources": [
{
"mode": "data",
"type": "aws_ami",
"name": "amazon_linux_2023",
"provider": "provider[\"registry.terraform.io/hashicorp/aws\"]",
"instances": [
{
"schema_version": 0,
"attributes": {
"architecture": "arm64",
"arn": "arn:aws:ec2:us-east-1::image/ami-0bd30c1fd5be4973c",
"block_device_mappings": [
{
"device_name": "/dev/xvda",
"ebs": {
"delete_on_termination": "true",
"encrypted": "false",
"iops": "3000",
"snapshot_id": "snap-05807063795fb989d",
"throughput": "125",
"volume_size": "30",
"volume_type": "gp3"
},
"no_device": "",
"virtual_name": ""
}
],
"boot_mode": "uefi",
"creation_date": "2026-04-14T22:46:31.000Z",
"deprecation_time": "2028-04-14T22:46:31.000Z",
"description": "Amazon Linux AMI 2023.0.20260414 arm64 ECS HVM EBS",
"ena_support": true,
"executable_users": null,
"filter": [
{
"name": "architecture",
"values": [
"arm64"
]
},
{
"name": "name",
"values": [
"al2023-ami-*"
]
},
{
"name": "virtualization-type",
"values": [
"hvm"
]
}
],
"hypervisor": "xen",
"id": "ami-0bd30c1fd5be4973c",
"image_id": "ami-0bd30c1fd5be4973c",
"image_location": "amazon/al2023-ami-ecs-hvm-2023.0.20260414-kernel-6.1-arm64",
"image_owner_alias": "amazon",
"image_type": "machine",
"imds_support": "v2.0",
"include_deprecated": false,
"kernel_id": "",
"most_recent": true,
"name": "al2023-ami-ecs-hvm-2023.0.20260414-kernel-6.1-arm64",
"name_regex": null,
"owner_id": "591542846629",
"owners": null,
"platform": "",
"platform_details": "Linux/UNIX",
"product_codes": [],
"public": true,
"ramdisk_id": "",
"root_device_name": "/dev/xvda",
"root_device_type": "ebs",
"root_snapshot_id": "snap-05807063795fb989d",
"sriov_net_support": "simple",
"state": "available",
"state_reason": {
"code": "UNSET",
"message": "UNSET"
},
"tags": {},
"timeouts": null,
"tpm_support": "",
"usage_operation": "RunInstances",
"virtualization_type": "hvm"
},
"sensitive_attributes": [],
"identity_schema_version": 0
}
]
},
{
"mode": "data",
"type": "aws_caller_identity",
"name": "current",
"provider": "provider[\"registry.terraform.io/hashicorp/aws\"]",
"instances": [
{
"schema_version": 0,
"attributes": {
"account_id": "679918342773",
"arn": "arn:aws:iam::679918342773:user/bryce",
"id": "679918342773",
"user_id": "AIDAJPUJFTOKO4IRADMV4"
},
"sensitive_attributes": [],
"identity_schema_version": 0
}
]
},
{
"mode": "data",
"type": "aws_iam_policy_document",
"name": "toast_policy_doc",
"provider": "provider[\"registry.terraform.io/hashicorp/aws\"]",
"instances": [
{
"schema_version": 0,
"attributes": {
"id": "1225966291",
"json": "{\n \"Version\": \"2012-10-17\",\n \"Statement\": [\n {\n \"Sid\": \"\",\n \"Effect\": \"Allow\",\n \"Action\": \"s3:*\",\n \"Resource\": [\n \"arn:aws:s3:::toast.app-new.app.integreatconsult.com/*\",\n \"arn:aws:s3:::toast.app-new.app.integreatconsult.com\"\n ],\n \"Principal\": {\n \"AWS\": [\n \"arn:aws:iam::679918342773:role/http-proxy\",\n \"arn:aws:iam::679918342773:role/datomic-ddb\"\n ]\n }\n }\n ]\n}",
"override_json": null,
"override_policy_documents": null,
"policy_id": null,
"source_json": null,
"source_policy_documents": null,
"statement": [
{
"actions": [
"s3:*"
],
"condition": [],
"effect": "Allow",
"not_actions": [],
"not_principals": [],
"not_resources": [],
"principals": [
{
"identifiers": [
"arn:aws:iam::679918342773:role/datomic-ddb",
"arn:aws:iam::679918342773:role/http-proxy"
],
"type": "AWS"
}
],
"resources": [
"arn:aws:s3:::toast.app-new.app.integreatconsult.com",
"arn:aws:s3:::toast.app-new.app.integreatconsult.com/*"
],
"sid": ""
}
],
"version": "2012-10-17"
},
"sensitive_attributes": [],
"identity_schema_version": 0
}
]
},
{
"mode": "managed",
"type": "aws_acm_certificate",
"name": "cert",
"provider": "provider[\"registry.terraform.io/hashicorp/aws\"]",
"instances": [
{
"schema_version": 0,
"attributes": {
"arn": "arn:aws:acm:us-east-1:679918342773:certificate/2bde6817-bc1a-4512-ac39-5adb173ae050",
"certificate_authority_arn": "",
"certificate_body": null,
"certificate_chain": null,
"domain_name": "app-new.integreatconsult.com",
"domain_validation_options": [
{
"domain_name": "app-new.integreatconsult.com",
"resource_record_name": "_3010a539a101cd8568abe60f2222c594.app-new.integreatconsult.com.",
"resource_record_type": "CNAME",
"resource_record_value": "_de570f0eee8f5b2317db235792f58a0b.jkddzztszm.acm-validations.aws."
}
],
"early_renewal_duration": "",
"id": "arn:aws:acm:us-east-1:679918342773:certificate/2bde6817-bc1a-4512-ac39-5adb173ae050",
"key_algorithm": "RSA_2048",
"not_after": "",
"not_before": "",
"options": [
{
"certificate_transparency_logging_preference": "ENABLED"
}
],
"pending_renewal": false,
"private_key": null,
"renewal_eligibility": "INELIGIBLE",
"renewal_summary": [],
"status": "PENDING_VALIDATION",
"subject_alternative_names": [
"app-new.integreatconsult.com"
],
"tags": null,
"tags_all": {},
"type": "AMAZON_ISSUED",
"validation_emails": [],
"validation_method": "DNS",
"validation_option": []
},
"sensitive_attributes": [
[
{
"type": "get_attr",
"value": "private_key"
}
]
],
"identity_schema_version": 0,
"private": "bnVsbA=="
}
]
},
{
"mode": "managed",
"type": "aws_acm_certificate",
"name": "data_cert",
"provider": "provider[\"registry.terraform.io/hashicorp/aws\"]",
"instances": [
{
"schema_version": 0,
"attributes": {
"arn": "arn:aws:acm:us-east-1:679918342773:certificate/33298bae-f68d-428d-94f9-91a48c146d64",
"certificate_authority_arn": "",
"certificate_body": null,
"certificate_chain": null,
"domain_name": "data.app-new.app.integreatconsult.com",
"domain_validation_options": [
{
"domain_name": "data.app-new.app.integreatconsult.com",
"resource_record_name": "_8ba587ecb795503fa49f65b5da788b84.data.app-new.app.integreatconsult.com.",
"resource_record_type": "CNAME",
"resource_record_value": "_c5c853e48c418aff8a15495c042a162c.jkddzztszm.acm-validations.aws."
}
],
"early_renewal_duration": "",
"id": "arn:aws:acm:us-east-1:679918342773:certificate/33298bae-f68d-428d-94f9-91a48c146d64",
"key_algorithm": "RSA_2048",
"not_after": "",
"not_before": "",
"options": [
{
"certificate_transparency_logging_preference": "ENABLED"
}
],
"pending_renewal": false,
"private_key": null,
"renewal_eligibility": "INELIGIBLE",
"renewal_summary": [],
"status": "PENDING_VALIDATION",
"subject_alternative_names": [
"data.app-new.app.integreatconsult.com"
],
"tags": null,
"tags_all": {},
"type": "AMAZON_ISSUED",
"validation_emails": [],
"validation_method": "DNS",
"validation_option": []
},
"sensitive_attributes": [
[
{
"type": "get_attr",
"value": "private_key"
}
]
],
"identity_schema_version": 0,
"private": "bnVsbA=="
}
]
},
{
"mode": "managed",
"type": "aws_ebs_volume",
"name": "solr_ec2_storage",
"provider": "provider[\"registry.terraform.io/hashicorp/aws\"]",
"instances": []
},
{
"mode": "managed",
"type": "aws_ecs_task_definition",
"name": "integreat_app",
"provider": "provider[\"registry.terraform.io/hashicorp/aws\"]",
"instances": [
{
"schema_version": 1,
"attributes": {
"arn": "arn:aws:ecs:us-east-1:679918342773:task-definition/integreat_app_app-new:1",
"arn_without_revision": "arn:aws:ecs:us-east-1:679918342773:task-definition/integreat_app_app-new",
"container_definitions": "[{\"cpu\":0,\"dockerLabels\":{\"com.datadoghq.tags.env\":\"app-new\",\"com.datadoghq.tags.service\":\"integreat-app\"},\"environment\":[{\"name\":\"DD_ENV\",\"value\":\"app-new\"},{\"name\":\"DD_SERVICE\",\"value\":\"integreat-app\"},{\"name\":\"config\",\"value\":\"/usr/local/config/prod-new.edn\"}],\"essential\":true,\"image\":\"679918342773.dkr.ecr.us-east-1.amazonaws.com/integreat-cloud:prod\",\"logConfiguration\":{\"logDriver\":\"awslogs\",\"options\":{\"awslogs-group\":\"/ecs/integreat-app-new\",\"awslogs-region\":\"us-east-1\",\"awslogs-stream-prefix\":\"ecs\"}},\"mountPoints\":[],\"name\":\"integreat-app\",\"portMappings\":[{\"containerPort\":3000,\"hostPort\":3000,\"protocol\":\"tcp\"},{\"containerPort\":9000,\"hostPort\":9000,\"protocol\":\"tcp\"}],\"systemControls\":[],\"volumesFrom\":[]},{\"cpu\":0,\"environment\":[{\"name\":\"DD_API_KEY\",\"value\":\"ce10d932c47b358e81081ae67bd8c112\"},{\"name\":\"ECS_FARGATE\",\"value\":\"true\"}],\"essential\":true,\"image\":\"public.ecr.aws/datadog/agent:latest\",\"mountPoints\":[],\"name\":\"datadog-agent\",\"portMappings\":[],\"systemControls\":[],\"volumesFrom\":[]}]",
"cpu": "4096",
"ephemeral_storage": [],
"execution_role_arn": "arn:aws:iam::679918342773:role/ecsTaskExecutionRole",
"family": "integreat_app_app-new",
"id": "integreat_app_app-new",
"inference_accelerator": [],
"ipc_mode": "",
"memory": "16384",
"network_mode": "awsvpc",
"pid_mode": "",
"placement_constraints": [],
"proxy_configuration": [],
"requires_compatibilities": [
"FARGATE"
],
"revision": 1,
"runtime_platform": [],
"skip_destroy": false,
"tags": null,
"tags_all": {},
"task_role_arn": "arn:aws:iam::679918342773:role/datomic-ddb",
"volume": []
},
"sensitive_attributes": [],
"identity_schema_version": 0,
"private": "eyJzY2hlbWFfdmVyc2lvbiI6IjEifQ=="
}
]
},
{
"mode": "managed",
"type": "aws_efs_file_system",
"name": "solr_storage",
"provider": "provider[\"registry.terraform.io/hashicorp/aws\"]",
"instances": [
{
"index_key": 0,
"schema_version": 0,
"attributes": {
"arn": "arn:aws:elasticfilesystem:us-east-1:679918342773:file-system/fs-0486d889f5a7706e8",
"availability_zone_id": "",
"availability_zone_name": "",
"creation_token": "solr_storage-staging",
"dns_name": "fs-0486d889f5a7706e8.efs.us-east-1.amazonaws.com",
"encrypted": false,
"id": "fs-0486d889f5a7706e8",
"kms_key_id": "",
"lifecycle_policy": [],
"number_of_mount_targets": 6,
"owner_id": "679918342773",
"performance_mode": "generalPurpose",
"provisioned_throughput_in_mibps": 0,
"size_in_bytes": [
{
"value": 484864000,
"value_in_ia": 0,
"value_in_standard": 484864000
}
],
"tags": {
"Name": "solr_storage_staging"
},
"tags_all": {
"Name": "solr_storage_staging"
},
"throughput_mode": "bursting"
},
"sensitive_attributes": [],
"identity_schema_version": 0,
"private": "bnVsbA=="
}
]
},
{
"mode": "managed",
"type": "aws_iam_access_key",
"name": "app_user",
"provider": "provider[\"registry.terraform.io/hashicorp/aws\"]",
"instances": [
{
"schema_version": 0,
"attributes": {
"create_date": "2026-04-27T03:28:31Z",
"encrypted_secret": null,
"encrypted_ses_smtp_password_v4": null,
"id": "AKIAZ4TSKSJ2VGEYT3KL",
"key_fingerprint": null,
"pgp_key": null,
"secret": "G47l1ZO+LsqarmspEj2GNAGprJb6kcSMIZRpLtAe",
"ses_smtp_password_v4": "BFHdF2CM3EVw3+azoybICm2MDtb/Y/xRgdQUqN2KzRAt",
"status": "Active",
"user": "integreat-app-new"
},
"sensitive_attributes": [
[
{
"type": "get_attr",
"value": "secret"
}
],
[
{
"type": "get_attr",
"value": "ses_smtp_password_v4"
}
]
],
"identity_schema_version": 0,
"private": "bnVsbA==",
"dependencies": [
"aws_iam_user.app_user"
]
}
]
},
{
"mode": "managed",
"type": "aws_iam_user",
"name": "app_user",
"provider": "provider[\"registry.terraform.io/hashicorp/aws\"]",
"instances": [
{
"schema_version": 0,
"attributes": {
"arn": "arn:aws:iam::679918342773:user/integreat-app-new",
"force_destroy": false,
"id": "integreat-app-new",
"name": "integreat-app-new",
"path": "/",
"permissions_boundary": null,
"tags": {},
"tags_all": {},
"unique_id": "AIDAZ4TSKSJ2SDDJ5OMWV"
},
"sensitive_attributes": [],
"identity_schema_version": 0,
"private": "bnVsbA=="
}
]
},
{
"mode": "managed",
"type": "aws_iam_user_policy_attachment",
"name": "app_user_policy",
"provider": "provider[\"registry.terraform.io/hashicorp/aws\"]",
"instances": [
{
"schema_version": 0,
"attributes": {
"id": "integreat-app-new-20260427032831988600000001",
"policy_arn": "arn:aws:iam::aws:policy/AdministratorAccess",
"user": "integreat-app-new"
},
"sensitive_attributes": [],
"identity_schema_version": 0,
"private": "bnVsbA==",
"dependencies": [
"aws_iam_user.app_user"
]
}
]
},
{
"mode": "managed",
"type": "aws_instance",
"name": "solr_ec2",
"provider": "provider[\"registry.terraform.io/hashicorp/aws\"]",
"instances": []
},
{
"mode": "managed",
"type": "aws_lb",
"name": "integreat_app",
"provider": "provider[\"registry.terraform.io/hashicorp/aws\"]",
"instances": [
{
"schema_version": 0,
"attributes": {
"access_logs": [
{
"bucket": "",
"enabled": false,
"prefix": ""
}
],
"arn": "arn:aws:elasticloadbalancing:us-east-1:679918342773:loadbalancer/app/integreat-app-staging/d65758eb97c8e4e5",
"arn_suffix": "app/integreat-app-staging/d65758eb97c8e4e5",
"customer_owned_ipv4_pool": "",
"desync_mitigation_mode": "defensive",
"dns_name": "integreat-app-staging-1122841226.us-east-1.elb.amazonaws.com",
"drop_invalid_header_fields": false,
"enable_cross_zone_load_balancing": true,
"enable_deletion_protection": true,
"enable_http2": true,
"enable_tls_version_and_cipher_suite_headers": false,
"enable_waf_fail_open": false,
"enable_xff_client_port": false,
"id": "arn:aws:elasticloadbalancing:us-east-1:679918342773:loadbalancer/app/integreat-app-staging/d65758eb97c8e4e5",
"idle_timeout": 120,
"internal": false,
"ip_address_type": "ipv4",
"load_balancer_type": "application",
"name": "integreat-app-staging",
"name_prefix": null,
"preserve_host_header": false,
"security_groups": [
"sg-0024906e0e1f78048"
],
"subnet_mapping": [
{
"allocation_id": "",
"ipv6_address": "",
"outpost_id": "",
"private_ipv4_address": "",
"subnet_id": "subnet-16161a39"
},
{
"allocation_id": "",
"ipv6_address": "",
"outpost_id": "",
"private_ipv4_address": "",
"subnet_id": "subnet-323deb78"
},
{
"allocation_id": "",
"ipv6_address": "",
"outpost_id": "",
"private_ipv4_address": "",
"subnet_id": "subnet-44c2774b"
},
{
"allocation_id": "",
"ipv6_address": "",
"outpost_id": "",
"private_ipv4_address": "",
"subnet_id": "subnet-5e675761"
},
{
"allocation_id": "",
"ipv6_address": "",
"outpost_id": "",
"private_ipv4_address": "",
"subnet_id": "subnet-8519fde2"
},
{
"allocation_id": "",
"ipv6_address": "",
"outpost_id": "",
"private_ipv4_address": "",
"subnet_id": "subnet-89bab8d4"
}
],
"subnets": [
"subnet-16161a39",
"subnet-323deb78",
"subnet-44c2774b",
"subnet-5e675761",
"subnet-8519fde2",
"subnet-89bab8d4"
],
"tags": {},
"tags_all": {},
"timeouts": null,
"vpc_id": "vpc-b5b7d6ce",
"xff_header_processing_mode": "append",
"zone_id": "Z35SXDOTRQ7X7K"
},
"sensitive_attributes": [],
"identity_schema_version": 0,
"private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjo2MDAwMDAwMDAwMDAsImRlbGV0ZSI6NjAwMDAwMDAwMDAwLCJ1cGRhdGUiOjYwMDAwMDAwMDAwMH19"
}
]
},
{
"mode": "managed",
"type": "aws_lb_target_group",
"name": "integreat_app",
"provider": "provider[\"registry.terraform.io/hashicorp/aws\"]",
"instances": [
{
"schema_version": 0,
"attributes": {
"arn": "arn:aws:elasticloadbalancing:us-east-1:679918342773:targetgroup/integreat-app-app-new/f9c145c2d799a1ce",
"arn_suffix": "targetgroup/integreat-app-app-new/f9c145c2d799a1ce",
"connection_termination": false,
"deregistration_delay": "120",
"health_check": [
{
"enabled": true,
"healthy_threshold": 2,
"interval": 60,
"matcher": "200",
"path": "/api/health-check",
"port": "traffic-port",
"protocol": "HTTP",
"timeout": 14,
"unhealthy_threshold": 3
}
],
"id": "arn:aws:elasticloadbalancing:us-east-1:679918342773:targetgroup/integreat-app-app-new/f9c145c2d799a1ce",
"ip_address_type": "ipv4",
"lambda_multi_value_headers_enabled": false,
"load_balancing_algorithm_type": "round_robin",
"load_balancing_cross_zone_enabled": "use_load_balancer_configuration",
"name": "integreat-app-app-new",
"name_prefix": null,
"port": 80,
"preserve_client_ip": null,
"protocol": "HTTP",
"protocol_version": "HTTP1",
"proxy_protocol_v2": false,
"slow_start": 0,
"stickiness": [
{
"cookie_duration": 86400,
"cookie_name": "",
"enabled": false,
"type": "lb_cookie"
}
],
"tags": null,
"tags_all": {},
"target_failover": [
{
"on_deregistration": null,
"on_unhealthy": null
}
],
"target_type": "ip",
"vpc_id": "vpc-b5b7d6ce"
},
"sensitive_attributes": [],
"identity_schema_version": 0,
"private": "bnVsbA=="
}
]
},
{
"mode": "managed",
"type": "aws_s3_bucket",
"name": "invoices",
"provider": "provider[\"registry.terraform.io/hashicorp/aws\"]",
"instances": [
{
"schema_version": 0,
"attributes": {
"acceleration_status": "",
"acl": "private",
"arn": "arn:aws:s3:::integreat-mail-staging",
"bucket": "integreat-mail-staging",
"bucket_domain_name": "integreat-mail-staging.s3.amazonaws.com",
"bucket_prefix": "",
"bucket_regional_domain_name": "integreat-mail-staging.s3.amazonaws.com",
"cors_rule": [],
"force_destroy": false,
"grant": [
{
"id": "e30528e0ba05fd1f250869c1b4db0eff90001b4d9ad90dd2e01b210844f83e5a",
"permissions": [
"FULL_CONTROL"
],
"type": "CanonicalUser",
"uri": ""
}
],
"hosted_zone_id": "Z3AQBSTGFYJSTF",
"id": "integreat-mail-staging",
"lifecycle_rule": [],
"logging": [],
"object_lock_configuration": [],
"object_lock_enabled": false,
"policy": "{\"Statement\":[{\"Action\":\"s3:PutObject\",\"Condition\":{\"StringEquals\":{\"aws:Referer\":\"679918342773\"}},\"Effect\":\"Allow\",\"Principal\":{\"Service\":\"ses.amazonaws.com\"},\"Resource\":\"arn:aws:s3:::integreat-mail-staging/*\",\"Sid\":\"AllowSESPuts\"}],\"Version\":\"2012-10-17\"}",
"region": "us-east-1",
"replication_configuration": [],
"request_payer": "BucketOwner",
"server_side_encryption_configuration": [
{
"rule": [
{
"apply_server_side_encryption_by_default": [
{
"kms_master_key_id": "",
"sse_algorithm": "AES256"
}
],
"bucket_key_enabled": false
}
]
}
],
"tags": {},
"tags_all": {},
"timeouts": null,
"versioning": [
{
"enabled": false,
"mfa_delete": false
}
],
"website": [],
"website_domain": null,
"website_endpoint": null
},
"sensitive_attributes": [],
"identity_schema_version": 0,
"private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjoxMjAwMDAwMDAwMDAwLCJkZWxldGUiOjM2MDAwMDAwMDAwMDAsInJlYWQiOjEyMDAwMDAwMDAwMDAsInVwZGF0ZSI6MTIwMDAwMDAwMDAwMH19",
"dependencies": [
"data.aws_caller_identity.current"
]
}
]
},
{
"mode": "managed",
"type": "aws_s3_bucket",
"name": "toast_bucket",
"provider": "provider[\"registry.terraform.io/hashicorp/aws\"]",
"instances": [
{
"schema_version": 0,
"attributes": {
"acceleration_status": "",
"acl": null,
"arn": "arn:aws:s3:::toast.app-new.app.integreatconsult.com",
"bucket": "toast.app-new.app.integreatconsult.com",
"bucket_domain_name": "toast.app-new.app.integreatconsult.com.s3.amazonaws.com",
"bucket_prefix": "",
"bucket_regional_domain_name": "toast.app-new.app.integreatconsult.com.s3.amazonaws.com",
"cors_rule": [],
"force_destroy": false,
"grant": [
{
"id": "e30528e0ba05fd1f250869c1b4db0eff90001b4d9ad90dd2e01b210844f83e5a",
"permissions": [
"FULL_CONTROL"
],
"type": "CanonicalUser",
"uri": ""
}
],
"hosted_zone_id": "Z3AQBSTGFYJSTF",
"id": "toast.app-new.app.integreatconsult.com",
"lifecycle_rule": [],
"logging": [],
"object_lock_configuration": [],
"object_lock_enabled": false,
"policy": "",
"region": "us-east-1",
"replication_configuration": [],
"request_payer": "BucketOwner",
"server_side_encryption_configuration": [
{
"rule": [
{
"apply_server_side_encryption_by_default": [
{
"kms_master_key_id": "",
"sse_algorithm": "AES256"
}
],
"bucket_key_enabled": false
}
]
}
],
"tags": null,
"tags_all": {},
"timeouts": null,
"versioning": [
{
"enabled": false,
"mfa_delete": false
}
],
"website": [],
"website_domain": null,
"website_endpoint": null
},
"sensitive_attributes": [],
"identity_schema_version": 0,
"private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjoxMjAwMDAwMDAwMDAwLCJkZWxldGUiOjM2MDAwMDAwMDAwMDAsInJlYWQiOjEyMDAwMDAwMDAwMDAsInVwZGF0ZSI6MTIwMDAwMDAwMDAwMH19"
}
]
},
{
"mode": "managed",
"type": "aws_s3_bucket_policy",
"name": "toast_policy",
"provider": "provider[\"registry.terraform.io/hashicorp/aws\"]",
"instances": [
{
"schema_version": 0,
"attributes": {
"bucket": "toast.app-new.app.integreatconsult.com",
"id": "toast.app-new.app.integreatconsult.com",
"policy": "{\"Statement\":[{\"Action\":\"s3:*\",\"Effect\":\"Allow\",\"Principal\":{\"AWS\":[\"arn:aws:iam::679918342773:role/http-proxy\",\"arn:aws:iam::679918342773:role/datomic-ddb\"]},\"Resource\":[\"arn:aws:s3:::toast.app-new.app.integreatconsult.com/*\",\"arn:aws:s3:::toast.app-new.app.integreatconsult.com\"],\"Sid\":\"\"}],\"Version\":\"2012-10-17\"}"
},
"sensitive_attributes": [],
"identity_schema_version": 0,
"private": "bnVsbA==",
"dependencies": [
"aws_s3_bucket.toast_bucket",
"data.aws_iam_policy_document.toast_policy_doc"
]
}
]
},
{
"mode": "managed",
"type": "aws_service_discovery_instance",
"name": "solr_instance",
"provider": "provider[\"registry.terraform.io/hashicorp/aws\"]",
"instances": []
},
{
"mode": "managed",
"type": "aws_service_discovery_service",
"name": "service",
"provider": "provider[\"registry.terraform.io/hashicorp/aws\"]",
"instances": [
{
"schema_version": 0,
"attributes": {
"arn": "arn:aws:servicediscovery:us-east-1:679918342773:service/srv-cnyrecgz6kpe3hmi",
"description": "",
"dns_config": [
{
"dns_records": [
{
"ttl": 10,
"type": "A"
}
],
"namespace_id": "ns-gv2z744em7myo2jp",
"routing_policy": "MULTIVALUE"
}
],
"force_destroy": false,
"health_check_config": [],
"health_check_custom_config": [
{
"failure_threshold": 1
}
],
"id": "srv-cnyrecgz6kpe3hmi",
"name": "integreat-app-app-new",
"namespace_id": "ns-gv2z744em7myo2jp",
"tags": null,
"tags_all": {},
"type": "DNS_HTTP"
},
"sensitive_attributes": [],
"identity_schema_version": 0,
"private": "bnVsbA=="
}
]
},
{
"mode": "managed",
"type": "aws_service_discovery_service",
"name": "solr_ec2",
"provider": "provider[\"registry.terraform.io/hashicorp/aws\"]",
"instances": []
},
{
"mode": "managed",
"type": "aws_ses_receipt_rule_set",
"name": "main",
"provider": "provider[\"registry.terraform.io/hashicorp/aws\"]",
"instances": [
{
"schema_version": 0,
"attributes": {
"arn": "arn:aws:ses:us-east-1:679918342773:receipt-rule-set/default-rule-set",
"id": "default-rule-set",
"rule_set_name": "default-rule-set"
},
"sensitive_attributes": [],
"identity_schema_version": 0
}
]
},
{
"mode": "managed",
"type": "aws_sqs_queue",
"name": "background-request",
"provider": "provider[\"registry.terraform.io/hashicorp/aws\"]",
"instances": [
{
"schema_version": 0,
"attributes": {
"arn": "arn:aws:sqs:us-east-1:679918342773:integreat-background-request-app-new",
"content_based_deduplication": false,
"deduplication_scope": "",
"delay_seconds": 0,
"fifo_queue": false,
"fifo_throughput_limit": "",
"id": "https://sqs.us-east-1.amazonaws.com/679918342773/integreat-background-request-app-new",
"kms_data_key_reuse_period_seconds": 300,
"kms_master_key_id": "",
"max_message_size": 262144,
"message_retention_seconds": 345600,
"name": "integreat-background-request-app-new",
"name_prefix": "",
"policy": "{\"Statement\":[{\"Action\":\"sqs:*\",\"Effect\":\"Allow\",\"Principal\":{\"AWS\":\"arn:aws:iam::679918342773:role/datomic-ddb\"},\"Resource\":\"arn:aws:sqs:*:*:integreat-background-request-app-new\"}],\"Version\":\"2012-10-17\"}",
"receive_wait_time_seconds": 0,
"redrive_allow_policy": "",
"redrive_policy": "",
"sqs_managed_sse_enabled": true,
"tags": null,
"tags_all": {},
"url": "https://sqs.us-east-1.amazonaws.com/679918342773/integreat-background-request-app-new",
"visibility_timeout_seconds": 30
},
"sensitive_attributes": [],
"identity_schema_version": 0,
"private": "bnVsbA=="
}
]
},
{
"mode": "managed",
"type": "aws_sqs_queue",
"name": "integreat-scheduled-jobs",
"provider": "provider[\"registry.terraform.io/hashicorp/aws\"]",
"instances": [
{
"schema_version": 0,
"attributes": {
"arn": "arn:aws:sqs:us-east-1:679918342773:integreat-scheduled-jobs-app-new",
"content_based_deduplication": false,
"deduplication_scope": "",
"delay_seconds": 0,
"fifo_queue": false,
"fifo_throughput_limit": "",
"id": "https://sqs.us-east-1.amazonaws.com/679918342773/integreat-scheduled-jobs-app-new",
"kms_data_key_reuse_period_seconds": 300,
"kms_master_key_id": "",
"max_message_size": 262144,
"message_retention_seconds": 345600,
"name": "integreat-scheduled-jobs-app-new",
"name_prefix": "",
"policy": "{\"Statement\":[{\"Action\":\"sqs:*\",\"Effect\":\"Allow\",\"Principal\":{\"AWS\":\"arn:aws:iam::679918342773:role/datomic-ddb\"},\"Resource\":\"arn:aws:sqs:*:*:integreat-scheduled-jobs-app-new\"}],\"Version\":\"2012-10-17\"}",
"receive_wait_time_seconds": 0,
"redrive_allow_policy": "",
"redrive_policy": "",
"sqs_managed_sse_enabled": true,
"tags": null,
"tags_all": {},
"url": "https://sqs.us-east-1.amazonaws.com/679918342773/integreat-scheduled-jobs-app-new",
"visibility_timeout_seconds": 30
},
"sensitive_attributes": [],
"identity_schema_version": 0,
"private": "bnVsbA=="
}
]
},
{
"mode": "managed",
"type": "aws_volume_attachment",
"name": "attach_solr_storage",
"provider": "provider[\"registry.terraform.io/hashicorp/aws\"]",
"instances": []
}
],
"check_results": null
}

File diff suppressed because it is too large Load Diff

View File

@@ -51,3 +51,22 @@
(is (= "720.33" (:total (nth results 1))))
(is (= "853.16" (:total (nth results 2))))
(is (= "1066.60" (:total (nth results 3)))))))
(deftest parse-bonanza-produce-invoice-03882095
(testing "Should parse Bonanza Produce invoice 03882095 with customer identifier including address"
(let [pdf-file (io/file "dev-resources/INVOICE - 03882095.pdf")
pdf-text (:out (clojure.java.shell/sh "pdftotext" "-layout" (str pdf-file) "-"))
results (sut/parse pdf-text)
result (first results)]
(is (some? results) "parse should return a result")
(is (some? result) "Template should match and return a result")
(when result
(is (= "Bonanza Produce" (:vendor-code result)))
(is (= "03882095" (:invoice-number result)))
(let [d (:date result)]
(is (= 2026 (time/year d)))
(is (= 1 (time/month d)))
(is (= 23 (time/day d))))
(is (= "NICK THE GREEK" (:customer-identifier result)))
(is (= "600 VISTA WAY" (str/trim (:account-number result))))
(is (= "946.24" (:total result)))))))