Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/msa-ez/platform
Browse files Browse the repository at this point in the history
  • Loading branch information
kibum0405 committed Jan 7, 2025
2 parents ed5721c + f68585d commit 49f53c6
Show file tree
Hide file tree
Showing 26 changed files with 11,671 additions and 1,297 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@
</template>
<script>
import ESValueSummarizeWithFilterUtil from "../../modeling/generators/es-ddl-generators/modules/ESValueSummarizeWithFilterUtil"
import ESAliasTransManager from "../../modeling/generators/es-ddl-generators/modules/ESAliasTransManager"
import DraftGeneratorByFunctions from "../../modeling/generators/es-ddl-generators/DraftGeneratorByFunctions";
import ESActionsUtil from "../../modeling/generators/es-ddl-generators/modules/ESActionsUtil";
import TokenCounterTest from "../../modeling/generators/utils/TokenCounter/tests";
import ESValueSummaryGeneratorTest from "../../modeling/generators/es-generators/ESValueSummaryGenerator/tests";
import ESValueSummarizeWithFilterTest from "../../modeling/generators/es-generators/helpers/ESValueSummarizeWithFilter/tests";

export default {
name: "es-test-terminal",
Expand Down Expand Up @@ -610,16 +609,8 @@ export default {
}
},

_ESSummaryTest() {
const targetBoundedContext = Object.values(this.value.elements).find(element => element && element.name === "LoanManagement")

const summary = ESValueSummarizeWithFilterUtil.getSummarizedESValue(
this.value,
[],
new ESAliasTransManager(this.value)
)

console.log(summary)
async _ESSummaryTest() {
await ESValueSummarizeWithFilterTest.test(this.value)
},

_CommandGeneratorTestByLibrary() {
Expand Down Expand Up @@ -1041,346 +1032,10 @@ export default {
},

_ESSummaryGeneratorTest() {
const summariezedESValue = ESValueSummarizeWithFilterUtil.getSummarizedESValue(
this.value, [], new ESAliasTransManager(this.value)
)
console.log(summariezedESValue)
console.log("[*] 전체 ESValue 토큰 수 :", TokenCounter.getTokenCount(JSON.stringify(summariezedESValue), "gpt-4o"))
},

_TempTest() {
const commandsToReplace = [
{
"_type": "org.uengine.modeling.model.Command",
"outputEvents": [
"LoanApplied"
],
"aggregate": {
"id": "59630231-1ccf-f632-a379-e948f3d281fb"
},
"author": "EYCl46CwWAWvpz2E1BCUpVgPIpa2",
"boundedContext": {
"id": "7b15d63b-9505-8216-80d3-1b0a189a12ca"
},
"controllerInfo": {
"method": "POST"
},
"fieldDescriptors": [
{
"className": "String",
"isCopy": false,
"isKey": false,
"name": "memberId",
"nameCamelCase": "memberId",
"namePascalCase": "MemberId",
"displayName": "",
"_type": "org.uengine.model.FieldDescriptor"
},
{
"className": "Integer",
"isCopy": false,
"isKey": false,
"name": "loanPeriod",
"nameCamelCase": "loanPeriod",
"namePascalCase": "LoanPeriod",
"displayName": "",
"_type": "org.uengine.model.FieldDescriptor"
}
],
"description": null,
"id": "c877e530-3352-6f59-3de8-78b0dd449960",
"elementView": {
"_type": "org.uengine.modeling.model.Command",
"height": 116,
"id": "c877e530-3352-6f59-3de8-78b0dd449960",
"style": "{}",
"width": 100,
"x": 1141,
"y": 250,
"z-index": 999
},
"hexagonalView": {
"_type": "org.uengine.modeling.model.CommandHexagonal",
"height": 0,
"id": "c877e530-3352-6f59-3de8-78b0dd449960",
"style": "{}",
"width": 0,
"x": 0,
"y": 0
},
"isRestRepository": false,
"name": "ApplyLoan",
"displayName": "대출 신청",
"nameCamelCase": "applyLoan",
"namePascalCase": "ApplyLoan",
"namePlural": "applyLoans",
"relationCommandInfo": [],
"relationEventInfo": [],
"restRepositoryInfo": {
"method": "POST"
},
"rotateStatus": false,
"selected": false,
"trigger": "@PrePersist",
"examples": [
{
"given": [
{
"type": "Aggregate",
"name": "Loan",
"value": {
"loanId": null,
"member": {
"memberId": "MEM-001",
"name": "홍길동"
},
"loanPeriod": null,
"loanStatus": "N/A",
"loanDate": null,
"returnDueDate": null,
"bookId": {
"bookId": "BOOK-001",
"title": "Clean Code",
"isbn": "123-456-789"
}
}
}
],
"when": [
{
"type": "Command",
"name": "ApplyLoan",
"value": {
"memberId": "MEM-001",
"loanPeriod": 14
}
}
],
"then": [
{
"type": "Event",
"name": "LoanApplied",
"value": {
"memberId": "MEM-001",
"loanDate": "2024-03-20T00:00:00Z",
"returnDueDate": "2024-04-03T00:00:00Z",
"loanStatus": "BORROWED"
}
}
]
}
]
},
{
"_type": "org.uengine.modeling.model.Command",
"outputEvents": [
"LoanExtended"
],
"aggregate": {
"id": "59630231-1ccf-f632-a379-e948f3d281fb"
},
"author": "EYCl46CwWAWvpz2E1BCUpVgPIpa2",
"boundedContext": {
"id": "7b15d63b-9505-8216-80d3-1b0a189a12ca"
},
"controllerInfo": {
"method": "PUT"
},
"fieldDescriptors": [
{
"className": "Integer",
"isCopy": false,
"isKey": false,
"name": "extensionPeriod",
"nameCamelCase": "extensionPeriod",
"namePascalCase": "ExtensionPeriod",
"displayName": "",
"_type": "org.uengine.model.FieldDescriptor"
}
],
"description": null,
"id": "7aa3f0e9-241d-50ef-0170-75b4869319d5",
"elementView": {
"_type": "org.uengine.modeling.model.Command",
"height": 116,
"id": "7aa3f0e9-241d-50ef-0170-75b4869319d5",
"style": "{}",
"width": 100,
"x": 1141,
"y": 380,
"z-index": 999
ESValueSummaryGeneratorTest.test(this.value)
},
"hexagonalView": {
"_type": "org.uengine.modeling.model.CommandHexagonal",
"height": 0,
"id": "7aa3f0e9-241d-50ef-0170-75b4869319d5",
"style": "{}",
"width": 0,
"x": 0,
"y": 0
},
"isRestRepository": false,
"name": "ExtendLoan",
"displayName": "대출 연장",
"nameCamelCase": "extendLoan",
"namePascalCase": "ExtendLoan",
"namePlural": "extendLoans",
"relationCommandInfo": [],
"relationEventInfo": [],
"restRepositoryInfo": {
"method": "PUT"
},
"rotateStatus": false,
"selected": false,
"trigger": "@PrePersist",
"examples": [
{
"given": [
{
"type": "Aggregate",
"name": "Loan",
"value": {
"loanId": 101,
"member": {
"memberId": "MEM-002",
"name": "김철수"
},
"loanPeriod": 14,
"loanStatus": "BORROWED",
"loanDate": "2024-03-01T00:00:00Z",
"returnDueDate": "2024-03-15T00:00:00Z",
"bookId": {
"bookId": "BOOK-002",
"title": "Effective Java",
"isbn": "789-456-123"
}
}
}
],
"when": [
{
"type": "Command",
"name": "ExtendLoan",
"value": {
"extensionPeriod": 7
}
}
],
"then": [
{
"type": "Event",
"name": "LoanExtended",
"value": {
"extendedDate": "2024-03-15T00:00:00Z",
"newReturnDueDate": "2024-03-22T00:00:00Z"
}
}
]
}
]
},
{
"_type": "org.uengine.modeling.model.Command",
"outputEvents": [
"BookReturned"
],
"aggregate": {
"id": "59630231-1ccf-f632-a379-e948f3d281fb"
},
"author": "EYCl46CwWAWvpz2E1BCUpVgPIpa2",
"boundedContext": {
"id": "7b15d63b-9505-8216-80d3-1b0a189a12ca"
},
"controllerInfo": {
"method": "PUT"
},
"fieldDescriptors": [],
"description": null,
"id": "b0d52bf5-95d4-2ab7-b442-5716f7eccb20",
"elementView": {
"_type": "org.uengine.modeling.model.Command",
"height": 116,
"id": "b0d52bf5-95d4-2ab7-b442-5716f7eccb20",
"style": "{}",
"width": 100,
"x": 1141,
"y": 510,
"z-index": 999
},
"hexagonalView": {
"_type": "org.uengine.modeling.model.CommandHexagonal",
"height": 0,
"id": "b0d52bf5-95d4-2ab7-b442-5716f7eccb20",
"style": "{}",
"width": 0,
"x": 0,
"y": 0
},
"isRestRepository": false,
"name": "ReturnBook",
"displayName": "반납 처리",
"nameCamelCase": "returnBook",
"namePascalCase": "ReturnBook",
"namePlural": "returnBooks",
"relationCommandInfo": [],
"relationEventInfo": [],
"restRepositoryInfo": {
"method": "PUT"
},
"rotateStatus": false,
"selected": false,
"trigger": "@PrePersist",
"examples": [
{
"given": [
{
"type": "Aggregate",
"name": "Loan",
"value": {
"loanId": 102,
"member": {
"memberId": "MEM-003",
"name": "박영희"
},
"loanPeriod": 14,
"loanStatus": "BORROWED",
"loanDate": "2024-02-15T00:00:00Z",
"returnDueDate": "2024-02-29T00:00:00Z",
"bookId": {
"bookId": "BOOK-003",
"title": "Domain-Driven Design",
"isbn": "456-789-123"
}
}
}
],
"when": [
{
"type": "Command",
"name": "ReturnBook",
"value": {}
}
],
"then": [
{
"type": "Event",
"name": "BookReturned",
"value": {
"returnedDate": "2024-02-28T00:00:00Z",
"bookStatus": "AVAILABLE"
}
}
]
}
]
}
]

for(const command of commandsToReplace)
this.$set(this.value.elements, command.id, command)
this.changedByMe = true

alert("교체됨 !")
async _TempTest() {
}
}
}
Expand Down
Loading

0 comments on commit 49f53c6

Please sign in to comment.