diff --git a/docs/model.ndm2 b/docs/model.ndm2 index 4037be3..db1f950 100644 --- a/docs/model.ndm2 +++ b/docs/model.ndm2 @@ -17657,230 +17657,6 @@ "dataCompressions": [] } }, - { - "objectType": "Table_MSSQL", - "name": "UserWallet", - "comment": "سرویس سبد خرید ", - "owner": "", - "isChangeTracking": false, - "isTrackColumnsUpdated": false, - "oldName": "ProductsService", - "isSystemTable": false, - "createTime": "", - "modifyTime": "", - "objectID": 3023, - "numberOfRows": 0, - "identityCurrent": 0, - "dataLength": 0, - "indexLength": 0, - "fields": [ - { - "objectType": "TableField_MSSQL", - "name": "GetAllUserWalletChangeLog", - "type": "Query", - "size": -2147483648, - "isNullable": "Yes", - "scale": -2147483648, - "comment": "واکشی لیست تغییرات کیف پول", - "computedExpression": "", - "defaultValue": "", - "defaultValueType": "None", - "schema": "", - "userDefinedType": "", - "collate": "", - "isWithValues": false, - "isFilestream": false, - "isColumnSet": false, - "isPersisted": false, - "isSparse": false, - "isRowGUIDColumn": false, - "oldName": "GetAllUserWalletChangeLog", - "computedBaseType": "", - "isDefaultConstraint": false, - "defaultConstraint": "", - "isIdentity": false, - "isExistingField": false, - "identitySeed": 0, - "identityIncrement": 0, - "identityIsNotForReplication": false - }, - { - "objectType": "TableField_MSSQL", - "name": "GetUserWallet", - "type": "Query", - "size": -2147483648, - "isNullable": "Yes", - "scale": -2147483648, - "comment": "واکشی کیف پول", - "computedExpression": "", - "defaultValue": "", - "defaultValueType": "None", - "schema": "", - "userDefinedType": "", - "collate": "", - "isWithValues": false, - "isFilestream": false, - "isColumnSet": false, - "isPersisted": false, - "isSparse": false, - "isRowGUIDColumn": false, - "oldName": "GetUserWallet", - "computedBaseType": "", - "isDefaultConstraint": false, - "defaultConstraint": "", - "isIdentity": false, - "isExistingField": false, - "identitySeed": 0, - "identityIncrement": 0, - "identityIsNotForReplication": false - }, - { - "objectType": "TableField_MSSQL", - "name": "TransferUserWalletBallance", - "type": "Command", - "size": -2147483648, - "isNullable": "Yes", - "scale": -2147483648, - "comment": "جابجایی موجودی", - "computedExpression": "", - "defaultValue": "", - "defaultValueType": "None", - "schema": "", - "userDefinedType": "", - "collate": "", - "isWithValues": false, - "isFilestream": false, - "isColumnSet": false, - "isPersisted": false, - "isSparse": false, - "isRowGUIDColumn": false, - "oldName": "TransferUserWalletBallance", - "computedBaseType": "", - "isDefaultConstraint": false, - "defaultConstraint": "", - "isIdentity": false, - "isExistingField": false, - "identitySeed": 0, - "identityIncrement": 0, - "identityIsNotForReplication": false - }, - { - "objectType": "TableField_MSSQL", - "name": "WithdrawBalance", - "type": "Command", - "size": -2147483648, - "isNullable": "Yes", - "scale": -2147483648, - "comment": "برداشت از حساب", - "computedExpression": "", - "defaultValue": "", - "defaultValueType": "None", - "schema": "", - "userDefinedType": "", - "collate": "", - "isWithValues": false, - "isFilestream": false, - "isColumnSet": false, - "isPersisted": false, - "isSparse": false, - "isRowGUIDColumn": false, - "oldName": "WithdrawBalance", - "computedBaseType": "", - "isDefaultConstraint": false, - "defaultConstraint": "", - "isIdentity": false, - "isExistingField": false, - "identitySeed": 0, - "identityIncrement": 0, - "identityIsNotForReplication": false - } - ], - "indexes": [], - "primaryKey": { - "objectType": "PrimaryKey_MSSQL", - "name": "_copy_25_copy_1_copy_1", - "fields": [], - "fillFactor": 0, - "oldName": "", - "isClustered": true, - "isPadded": false, - "noRecomputeStatistics": false, - "ignoreDuplicatedKeyValues": false, - "allowRowLocks": true, - "allowPageLocks": true, - "storage": { - "objectType": "Storage_MSSQL", - "name": "", - "oldName": "", - "storageType": "Default", - "filegroup": "", - "textImageFilegroup": "", - "filestreamFilegroup": "", - "partitionScheme": "", - "partitionColumn": "", - "filestreamPartitionScheme": "", - "dataCompressions": [] - } - }, - "foreignKeys": [ - { - "objectType": "ForeignKey_MSSQL", - "name": "fk_UserWallet_GetUserWalletResponse_1", - "fields": [ - "GetUserWallet" - ], - "referencedSchema": "FrontOffice", - "referencedTable": "GetUserWalletResponse", - "referencedFields": [ - "Balance" - ], - "onDelete": "", - "onUpdate": "", - "isNotForReplication": false, - "isEnabled": true, - "comment": "", - "sourceCardinality": "NoneRelationship", - "targetCardinality": "NoneRelationship", - "oldName": "" - }, - { - "objectType": "ForeignKey_MSSQL", - "name": "fk_UserWallet_GetAllUserWalletChangeLogResponse_1", - "fields": [ - "WithdrawBalance" - ], - "referencedSchema": "FrontOffice", - "referencedTable": "GetAllUserWalletChangeLogResponse", - "referencedFields": [ - "MetaData" - ], - "onDelete": "", - "onUpdate": "", - "isNotForReplication": false, - "isEnabled": true, - "comment": "", - "sourceCardinality": "NoneRelationship", - "targetCardinality": "NoneRelationship", - "oldName": "" - } - ], - "uniques": [], - "checks": [], - "triggers": [], - "storage": { - "objectType": "Storage_MSSQL", - "name": "", - "oldName": "", - "storageType": "Default", - "filegroup": "", - "textImageFilegroup": "", - "filestreamFilegroup": "", - "partitionScheme": "", - "partitionColumn": "", - "filestreamPartitionScheme": "", - "dataCompressions": [] - } - }, { "objectType": "Table_MSSQL", "name": "GetUserWalletResponse", @@ -18390,6 +18166,230 @@ "filestreamPartitionScheme": "", "dataCompressions": [] } + }, + { + "objectType": "Table_MSSQL", + "name": "UserWallet", + "comment": "سرویس سبد خرید ", + "owner": "", + "isChangeTracking": false, + "isTrackColumnsUpdated": false, + "oldName": "ProductsService", + "isSystemTable": false, + "createTime": "", + "modifyTime": "", + "objectID": 3023, + "numberOfRows": 0, + "identityCurrent": 0, + "dataLength": 0, + "indexLength": 0, + "fields": [ + { + "objectType": "TableField_MSSQL", + "name": "GetAllUserWalletChangeLog", + "type": "Query", + "size": -2147483648, + "isNullable": "Yes", + "scale": -2147483648, + "comment": "واکشی لیست تغییرات کیف پول", + "computedExpression": "", + "defaultValue": "", + "defaultValueType": "None", + "schema": "", + "userDefinedType": "", + "collate": "", + "isWithValues": false, + "isFilestream": false, + "isColumnSet": false, + "isPersisted": false, + "isSparse": false, + "isRowGUIDColumn": false, + "oldName": "GetAllUserWalletChangeLog", + "computedBaseType": "", + "isDefaultConstraint": false, + "defaultConstraint": "", + "isIdentity": false, + "isExistingField": false, + "identitySeed": 0, + "identityIncrement": 0, + "identityIsNotForReplication": false + }, + { + "objectType": "TableField_MSSQL", + "name": "GetUserWallet", + "type": "Query", + "size": -2147483648, + "isNullable": "Yes", + "scale": -2147483648, + "comment": "واکشی کیف پول", + "computedExpression": "", + "defaultValue": "", + "defaultValueType": "None", + "schema": "", + "userDefinedType": "", + "collate": "", + "isWithValues": false, + "isFilestream": false, + "isColumnSet": false, + "isPersisted": false, + "isSparse": false, + "isRowGUIDColumn": false, + "oldName": "GetUserWallet", + "computedBaseType": "", + "isDefaultConstraint": false, + "defaultConstraint": "", + "isIdentity": false, + "isExistingField": false, + "identitySeed": 0, + "identityIncrement": 0, + "identityIsNotForReplication": false + }, + { + "objectType": "TableField_MSSQL", + "name": "TransferUserWalletBallance", + "type": "Command", + "size": -2147483648, + "isNullable": "Yes", + "scale": -2147483648, + "comment": "جابجایی موجودی", + "computedExpression": "", + "defaultValue": "", + "defaultValueType": "None", + "schema": "", + "userDefinedType": "", + "collate": "", + "isWithValues": false, + "isFilestream": false, + "isColumnSet": false, + "isPersisted": false, + "isSparse": false, + "isRowGUIDColumn": false, + "oldName": "TransferUserWalletBallance", + "computedBaseType": "", + "isDefaultConstraint": false, + "defaultConstraint": "", + "isIdentity": false, + "isExistingField": false, + "identitySeed": 0, + "identityIncrement": 0, + "identityIsNotForReplication": false + }, + { + "objectType": "TableField_MSSQL", + "name": "WithdrawBalance", + "type": "Command", + "size": -2147483648, + "isNullable": "Yes", + "scale": -2147483648, + "comment": "برداشت از حساب", + "computedExpression": "", + "defaultValue": "", + "defaultValueType": "None", + "schema": "", + "userDefinedType": "", + "collate": "", + "isWithValues": false, + "isFilestream": false, + "isColumnSet": false, + "isPersisted": false, + "isSparse": false, + "isRowGUIDColumn": false, + "oldName": "WithdrawBalance", + "computedBaseType": "", + "isDefaultConstraint": false, + "defaultConstraint": "", + "isIdentity": false, + "isExistingField": false, + "identitySeed": 0, + "identityIncrement": 0, + "identityIsNotForReplication": false + } + ], + "indexes": [], + "primaryKey": { + "objectType": "PrimaryKey_MSSQL", + "name": "_copy_25_copy_1_copy_1", + "fields": [], + "fillFactor": 0, + "oldName": "", + "isClustered": true, + "isPadded": false, + "noRecomputeStatistics": false, + "ignoreDuplicatedKeyValues": false, + "allowRowLocks": true, + "allowPageLocks": true, + "storage": { + "objectType": "Storage_MSSQL", + "name": "", + "oldName": "", + "storageType": "Default", + "filegroup": "", + "textImageFilegroup": "", + "filestreamFilegroup": "", + "partitionScheme": "", + "partitionColumn": "", + "filestreamPartitionScheme": "", + "dataCompressions": [] + } + }, + "foreignKeys": [ + { + "objectType": "ForeignKey_MSSQL", + "name": "fk_UserWallet_GetUserWalletResponse_1", + "fields": [ + "GetUserWallet" + ], + "referencedSchema": "FrontOffice", + "referencedTable": "GetUserWalletResponse", + "referencedFields": [ + "Balance" + ], + "onDelete": "", + "onUpdate": "", + "isNotForReplication": false, + "isEnabled": true, + "comment": "", + "sourceCardinality": "NoneRelationship", + "targetCardinality": "NoneRelationship", + "oldName": "" + }, + { + "objectType": "ForeignKey_MSSQL", + "name": "fk_UserWallet_GetAllUserWalletChangeLogResponse_1", + "fields": [ + "GetAllUserWalletChangeLog" + ], + "referencedSchema": "FrontOffice", + "referencedTable": "GetAllUserWalletChangeLogResponse", + "referencedFields": [ + "MetaData" + ], + "onDelete": "", + "onUpdate": "", + "isNotForReplication": false, + "isEnabled": true, + "comment": "", + "sourceCardinality": "NoneRelationship", + "targetCardinality": "NoneRelationship", + "oldName": "" + } + ], + "uniques": [], + "checks": [], + "triggers": [], + "storage": { + "objectType": "Storage_MSSQL", + "name": "", + "oldName": "", + "storageType": "Default", + "filegroup": "", + "textImageFilegroup": "", + "filestreamFilegroup": "", + "partitionScheme": "", + "partitionColumn": "", + "filestreamPartitionScheme": "", + "dataCompressions": [] + } } ], "views": [] @@ -18721,7 +18721,7 @@ "schemaName": "FrontOffice", "tableName": "PackageService", "x": 940, - "y": 5350, + "y": 5670, "width": 400, "height": 120, "isBold": false, @@ -18737,7 +18737,7 @@ "schemaName": "FrontOffice", "tableName": "GetPackageRequest", "x": 1400, - "y": 5340, + "y": 5670, "width": 400, "height": 106, "isBold": false, @@ -18753,7 +18753,7 @@ "schemaName": "FrontOffice", "tableName": "GetPackageResponse", "x": 940, - "y": 5540, + "y": 5860, "width": 400, "height": 175, "isBold": false, @@ -18769,7 +18769,7 @@ "schemaName": "FrontOffice", "tableName": "GetAllPackageByFilterRequest", "x": 480, - "y": 5340, + "y": 5660, "width": 400, "height": 137, "isBold": false, @@ -18785,7 +18785,7 @@ "schemaName": "FrontOffice", "tableName": "GetAllPackageByFilterFilter", "x": 30, - "y": 5320, + "y": 5650, "width": 400, "height": 175, "isBold": false, @@ -18801,7 +18801,7 @@ "schemaName": "FrontOffice", "tableName": "GetAllPackageByFilterResponse", "x": 940, - "y": 5160, + "y": 5480, "width": 400, "height": 118, "isBold": false, @@ -18817,7 +18817,7 @@ "schemaName": "FrontOffice", "tableName": "GetAllPackageByFilterResponseModel", "x": 940, - "y": 4910, + "y": 5240, "width": 400, "height": 175, "isBold": false, @@ -18833,7 +18833,7 @@ "schemaName": "FrontOffice", "tableName": "UserOrderService", "x": 530, - "y": 4480, + "y": 4800, "width": 400, "height": 212, "isBold": false, @@ -18849,7 +18849,7 @@ "schemaName": "FrontOffice", "tableName": "CreateNewUserOrderRequest", "x": 880, - "y": 4090, + "y": 4420, "width": 400, "height": 230, "isBold": false, @@ -18865,7 +18865,7 @@ "schemaName": "FrontOffice", "tableName": "CreateNewUserOrderResponse", "x": 1040, - "y": 4370, + "y": 4690, "width": 400, "height": 106, "isBold": false, @@ -18881,7 +18881,7 @@ "schemaName": "FrontOffice", "tableName": "UpdateUserOrderRequest", "x": 400, - "y": 3620, + "y": 3650, "width": 400, "height": 130, "isBold": false, @@ -18897,7 +18897,7 @@ "schemaName": "FrontOffice", "tableName": "DeleteUserOrderRequest", "x": 30, - "y": 4530, + "y": 4850, "width": 400, "height": 106, "isBold": false, @@ -18913,7 +18913,7 @@ "schemaName": "FrontOffice", "tableName": "GetUserOrderRequest", "x": 530, - "y": 4740, + "y": 5060, "width": 400, "height": 106, "isBold": false, @@ -18929,7 +18929,7 @@ "schemaName": "FrontOffice", "tableName": "GetUserOrderResponse", "x": 2110, - "y": 4610, + "y": 4930, "width": 400, "height": 230, "isBold": false, @@ -18945,7 +18945,7 @@ "schemaName": "FrontOffice", "tableName": "GetAllUserOrderByFilterRequest", "x": 2110, - "y": 4420, + "y": 4750, "width": 400, "height": 137, "isBold": false, @@ -18961,7 +18961,7 @@ "schemaName": "FrontOffice", "tableName": "GetAllUserOrderByFilterFilter", "x": 2550, - "y": 4420, + "y": 4740, "width": 400, "height": 240, "isBold": false, @@ -18977,7 +18977,7 @@ "schemaName": "FrontOffice", "tableName": "GetAllUserOrderByFilterResponse", "x": 2050, - "y": 4250, + "y": 4580, "width": 400, "height": 118, "isBold": false, @@ -18993,7 +18993,7 @@ "schemaName": "FrontOffice", "tableName": "GetAllUserOrderByFilterResponseModel", "x": 2500, - "y": 4140, + "y": 4470, "width": 400, "height": 230, "isBold": false, @@ -19505,7 +19505,7 @@ "schemaName": "FrontOffice", "tableName": "ShopingCart", "x": 2770, - "y": 4970, + "y": 5300, "width": 400, "height": 175, "isBold": false, @@ -19521,7 +19521,7 @@ "schemaName": "FrontOffice", "tableName": "AddNewUserCartRequest", "x": 3230, - "y": 5010, + "y": 5330, "width": 400, "height": 106, "isBold": false, @@ -19537,7 +19537,7 @@ "schemaName": "FrontOffice", "tableName": "UpdateUserCartRequest", "x": 2770, - "y": 5200, + "y": 5520, "width": 400, "height": 106, "isBold": false, @@ -19553,7 +19553,7 @@ "schemaName": "FrontOffice", "tableName": "GetAllUserCartResponseModel", "x": 1860, - "y": 4910, + "y": 5240, "width": 400, "height": 296, "isBold": false, @@ -19569,7 +19569,7 @@ "schemaName": "FrontOffice", "tableName": "GetAllUserCartResponse", "x": 2320, - "y": 5000, + "y": 5330, "width": 400, "height": 118, "isBold": false, @@ -19585,7 +19585,7 @@ "schemaName": "FrontOffice", "tableName": "SubmitShopBuyOrderRequest", "x": 1540, - "y": 4400, + "y": 4720, "width": 400, "height": 106, "isBold": false, @@ -19601,7 +19601,7 @@ "schemaName": "FrontOffice", "tableName": "SubmitShopBuyOrderResponse", "x": 770, - "y": 3800, + "y": 3830, "width": 400, "height": 246, "isBold": false, @@ -19616,8 +19616,8 @@ "type": "table", "schemaName": "FrontOffice", "tableName": "SubmitShopBuyOrderFactorDetail", - "x": 1210, - "y": 3800, + "x": 770, + "y": 4120, "width": 400, "height": 246, "isBold": false, @@ -19632,9 +19632,9 @@ "type": "table", "schemaName": "FrontOffice", "tableName": "PaymentMethod", - "x": 873, - "y": 3568, - "width": 213, + "x": 1210, + "y": 3910, + "width": 280, "height": 100, "isBold": false, "titleColor": { @@ -19648,8 +19648,8 @@ "type": "table", "schemaName": "FrontOffice", "tableName": "PaymentStatus", - "x": 1255, - "y": 3570, + "x": 860, + "y": 3620, "width": 213, "height": 164, "isBold": false, @@ -19664,8 +19664,8 @@ "type": "table", "schemaName": "FrontOffice", "tableName": "UserWallet", - "x": 2438, - "y": 5451, + "x": 4730, + "y": 5290, "width": 400, "height": 175, "isBold": false, @@ -19680,8 +19680,8 @@ "type": "table", "schemaName": "FrontOffice", "tableName": "GetUserWalletResponse", - "x": 2003, - "y": 5381, + "x": 5190, + "y": 5300, "width": 385, "height": 143, "isBold": false, @@ -19696,8 +19696,8 @@ "type": "table", "schemaName": "FrontOffice", "tableName": "GetAllUserWalletChangeLogResponseModel", - "x": 2251, - "y": 5874, + "x": 3690, + "y": 5240, "width": 553, "height": 261, "isBold": false, @@ -19712,8 +19712,8 @@ "type": "table", "schemaName": "FrontOffice", "tableName": "GetAllUserWalletChangeLogResponse", - "x": 2413, - "y": 5694, + "x": 4290, + "y": 5300, "width": 385, "height": 143, "isBold": false, @@ -20304,16 +20304,16 @@ "vertices": [ { "x": 1355, - "y": 5400 + "y": 5720 }, { "x": 1385, - "y": 5400 + "y": 5720 } ], "label": { "x": 1351, - "y": 5372, + "y": 5692, "width": 280, "height": 32, "fontName": "Arial Unicode MS", @@ -20338,16 +20338,16 @@ "vertices": [ { "x": 1140, - "y": 5485 + "y": 5805 }, { "x": 1140, - "y": 5525 + "y": 5845 } ], "label": { "x": 1148, - "y": 5475, + "y": 5795, "width": 290, "height": 32, "fontName": "Arial Unicode MS", @@ -20372,16 +20372,16 @@ "vertices": [ { "x": 925, - "y": 5400 + "y": 5720 }, { "x": 895, - "y": 5400 + "y": 5720 } ], "label": { "x": 941, - "y": 5402, + "y": 5722, "width": 347, "height": 32, "fontName": "Arial Unicode MS", @@ -20406,16 +20406,16 @@ "vertices": [ { "x": 1140, - "y": 5335 + "y": 5655 }, { "x": 1140, - "y": 5293 + "y": 5613 } ], "label": { "x": 1148, - "y": 5345, + "y": 5665, "width": 357, "height": 32, "fontName": "Arial Unicode MS", @@ -20440,16 +20440,16 @@ "vertices": [ { "x": 465, - "y": 5400 + "y": 5720 }, { "x": 445, - "y": 5400 + "y": 5720 } ], "label": { "x": 481, - "y": 5402, + "y": 5722, "width": 409, "height": 32, "fontName": "Arial Unicode MS", @@ -20474,16 +20474,16 @@ "vertices": [ { "x": 1140, - "y": 5145 + "y": 5465 }, { "x": 1140, - "y": 5100 + "y": 5430 } ], "label": { "x": 1148, - "y": 5155, + "y": 5475, "width": 494, "height": 32, "fontName": "Arial Unicode MS", @@ -20508,20 +20508,20 @@ "vertices": [ { "x": 830, - "y": 4465 + "y": 4785 }, { "x": 830, - "y": 4210 + "y": 4530 }, { "x": 865, - "y": 4210 + "y": 4530 } ], "label": { "x": 838, - "y": 4475, + "y": 4795, "width": 354, "height": 32, "fontName": "Arial Unicode MS", @@ -20546,24 +20546,24 @@ "vertices": [ { "x": 945, - "y": 4500 + "y": 4820 }, { "x": 990, - "y": 4500 + "y": 4820 }, { "x": 990, - "y": 4450 + "y": 4770 }, { "x": 1025, - "y": 4450 + "y": 4770 } ], "label": { "x": 941, - "y": 4472, + "y": 4792, "width": 364, "height": 32, "fontName": "Arial Unicode MS", @@ -20588,16 +20588,16 @@ "vertices": [ { "x": 600, - "y": 4465 + "y": 4785 }, { "x": 600, - "y": 3765 + "y": 3795 } ], "label": { "x": 608, - "y": 4475, + "y": 4795, "width": 330, "height": 32, "fontName": "Arial Unicode MS", @@ -20622,16 +20622,16 @@ "vertices": [ { "x": 515, - "y": 4580 + "y": 4910 }, { "x": 445, - "y": 4580 + "y": 4910 } ], "label": { "x": 531, - "y": 4552, + "y": 4882, "width": 325, "height": 32, "fontName": "Arial Unicode MS", @@ -20656,16 +20656,16 @@ "vertices": [ { "x": 730, - "y": 4707 + "y": 5027 }, { "x": 730, - "y": 4725 + "y": 5045 } ], "label": { "x": 738, - "y": 4667, + "y": 4987, "width": 304, "height": 32, "fontName": "Arial Unicode MS", @@ -20690,16 +20690,16 @@ "vertices": [ { "x": 945, - "y": 4670 + "y": 4990 }, { "x": 2095, - "y": 4670 + "y": 4990 } ], "label": { "x": 941, - "y": 4672, + "y": 4992, "width": 314, "height": 32, "fontName": "Arial Unicode MS", @@ -20724,24 +20724,24 @@ "vertices": [ { "x": 945, - "y": 4580 + "y": 4910 }, { "x": 2060, - "y": 4580 + "y": 4910 }, { "x": 2060, - "y": 4500 + "y": 4820 }, { "x": 2095, - "y": 4500 + "y": 4820 } ], "label": { "x": 941, - "y": 4582, + "y": 4912, "width": 371, "height": 32, "fontName": "Arial Unicode MS", @@ -20766,24 +20766,24 @@ "vertices": [ { "x": 945, - "y": 4550 + "y": 4880 }, { "x": 2000, - "y": 4550 + "y": 4880 }, { "x": 2000, - "y": 4340 + "y": 4660 }, { "x": 2035, - "y": 4340 + "y": 4660 } ], "label": { "x": 941, - "y": 4552, + "y": 4882, "width": 381, "height": 32, "fontName": "Arial Unicode MS", @@ -20808,16 +20808,16 @@ "vertices": [ { "x": 2525, - "y": 4500 + "y": 4810 }, { "x": 2535, - "y": 4500 + "y": 4810 } ], "label": { "x": 2521, - "y": 4502, + "y": 4812, "width": 433, "height": 32, "fontName": "Arial Unicode MS", @@ -20842,16 +20842,16 @@ "vertices": [ { "x": 2465, - "y": 4310 + "y": 4630 }, { "x": 2485, - "y": 4310 + "y": 4630 } ], "label": { "x": 2461, - "y": 4312, + "y": 4632, "width": 518, "height": 32, "fontName": "Arial Unicode MS", @@ -22178,16 +22178,16 @@ "vertices": [ { "x": 3185, - "y": 5060 + "y": 5380 }, { "x": 3215, - "y": 5060 + "y": 5380 } ], "label": { "x": 2874, - "y": 5020, + "y": 5340, "width": 301, "height": 32, "fontName": "Sans", @@ -22212,16 +22212,16 @@ "vertices": [ { "x": 2970, - "y": 5160 + "y": 5490 }, { "x": 2970, - "y": 5185 + "y": 5505 } ], "label": { "x": 2679, - "y": 5108, + "y": 5438, "width": 293, "height": 32, "fontName": "Sans", @@ -22246,16 +22246,16 @@ "vertices": [ { "x": 2755, - "y": 5060 + "y": 5380 }, { "x": 2735, - "y": 5060 + "y": 5380 } ], "label": { "x": 2771, - "y": 5062, + "y": 5382, "width": 294, "height": 32, "fontName": "Sans", @@ -22280,16 +22280,16 @@ "vertices": [ { "x": 2305, - "y": 5060 + "y": 5380 }, { "x": 2275, - "y": 5060 + "y": 5380 } ], "label": { "x": 2321, - "y": 5062, + "y": 5382, "width": 416, "height": 32, "fontName": "Sans", @@ -22348,24 +22348,24 @@ "vertices": [ { "x": 945, - "y": 4530 + "y": 4850 }, { "x": 1490, - "y": 4530 + "y": 4850 }, { "x": 1490, - "y": 4470 + "y": 4800 }, { "x": 1525, - "y": 4470 + "y": 4800 } ], "label": { "x": 568, - "y": 4490, + "y": 4810, "width": 367, "height": 32, "fontName": "Sans", @@ -22390,20 +22390,20 @@ "vertices": [ { "x": 710, - "y": 4465 + "y": 4785 }, { "x": 710, - "y": 3930 + "y": 3960 }, { "x": 755, - "y": 3930 + "y": 3960 } ], "label": { "x": 335, - "y": 4433, + "y": 4753, "width": 377, "height": 32, "fontName": "Sans", @@ -22427,17 +22427,17 @@ "visible": true, "vertices": [ { - "x": 1185, - "y": 3930 + "x": 970, + "y": 4091 }, { - "x": 1195, - "y": 3930 + "x": 970, + "y": 4105 } ], "label": { - "x": 1181, - "y": 3900, + "x": 978, + "y": 4049, "width": 485, "height": 32, "fontName": "Sans", @@ -22461,25 +22461,17 @@ "visible": true, "vertices": [ { - "x": 970, - "y": 3785 + "x": 1185, + "y": 3960 }, { - "x": 970, - "y": 3734 - }, - { - "x": 979, - "y": 3734 - }, - { - "x": 979, - "y": 3683 + "x": 1195, + "y": 3960 } ], "label": { - "x": 978, - "y": 3763, + "x": 1181, + "y": 3930, "width": 368, "height": 32, "fontName": "Sans", @@ -22503,21 +22495,17 @@ "visible": true, "vertices": [ { - "x": 1185, - "y": 3940 + "x": 970, + "y": 3815 }, { - "x": 1361, - "y": 3940 - }, - { - "x": 1361, - "y": 3749 + "x": 970, + "y": 3799 } ], "label": { - "x": 1175, - "y": 3900, + "x": 972, + "y": 3783, "width": 358, "height": 32, "fontName": "Sans", @@ -22541,21 +22529,17 @@ "visible": true, "vertices": [ { - "x": 2423, - "y": 5538 + "x": 5145, + "y": 5370 }, { - "x": 2195, - "y": 5538 - }, - { - "x": 2195, - "y": 5539 + "x": 5175, + "y": 5370 } ], "label": { - "x": 2153, - "y": 5498, + "x": 4855, + "y": 5330, "width": 280, "height": 32, "fontName": "Sans", @@ -22579,25 +22563,17 @@ "visible": true, "vertices": [ { - "x": 2605, - "y": 5852 + "x": 4275, + "y": 5370 }, { - "x": 2605, - "y": 5855 - }, - { - "x": 2527, - "y": 5855 - }, - { - "x": 2527, - "y": 5859 + "x": 4258, + "y": 5370 } ], "label": { - "x": 2613, - "y": 5842, + "x": 4291, + "y": 5372, "width": 596, "height": 32, "fontName": "Sans", @@ -22621,25 +22597,25 @@ "visible": true, "vertices": [ { - "x": 2638, - "y": 5641 + "x": 4715, + "y": 5377 }, { - "x": 2638, - "y": 5660 + "x": 4702, + "y": 5377 }, { - "x": 2605, - "y": 5660 + "x": 4702, + "y": 5371 }, { - "x": 2605, - "y": 5679 + "x": 4690, + "y": 5371 } ], "label": { - "x": 2646, - "y": 5631, + "x": 4352, + "y": 5337, "width": 373, "height": 32, "fontName": "Sans", diff --git a/src/FrontOffice.BFF.Application/Common/Interfaces/IApplicationContractContext.cs b/src/FrontOffice.BFF.Application/Common/Interfaces/IApplicationContractContext.cs index f2ed78f..aa15953 100644 --- a/src/FrontOffice.BFF.Application/Common/Interfaces/IApplicationContractContext.cs +++ b/src/FrontOffice.BFF.Application/Common/Interfaces/IApplicationContractContext.cs @@ -6,6 +6,8 @@ using CMSMicroservice.Protobuf.Protos.UserAddress; using CMSMicroservice.Protobuf.Protos.UserCarts; using CMSMicroservice.Protobuf.Protos.UserContract; using CMSMicroservice.Protobuf.Protos.UserOrder; +using CMSMicroservice.Protobuf.Protos.UserWallet; +using CMSMicroservice.Protobuf.Protos.UserWalletChangeLog; using PYMSMicroservice.Protobuf.Protos.Transaction; namespace FrontOffice.BFF.Application.Common.Interfaces; @@ -27,6 +29,8 @@ public interface IApplicationContractContext UserAddressContract.UserAddressContractClient UserAddress { get; } UserOrderContract.UserOrderContractClient UserOrder { get; } OtpTokenContract.OtpTokenContractClient OtpToken { get; } + UserWalletContract.UserWalletContractClient UserWallet { get; } + UserWalletChangeLogContract.UserWalletChangeLogContractClient UserWalletChangeLog { get; } #endregion #region PYMS diff --git a/src/FrontOffice.BFF.Application/FrontOffice.BFF.Application.csproj b/src/FrontOffice.BFF.Application/FrontOffice.BFF.Application.csproj index e80bab5..38b83ef 100644 --- a/src/FrontOffice.BFF.Application/FrontOffice.BFF.Application.csproj +++ b/src/FrontOffice.BFF.Application/FrontOffice.BFF.Application.csproj @@ -13,6 +13,7 @@ + diff --git a/src/FrontOffice.BFF.Application/UserOrderCQ/Commands/SubmitShopBuyOrder/SubmitShopBuyOrderCommandHandler.cs b/src/FrontOffice.BFF.Application/UserOrderCQ/Commands/SubmitShopBuyOrder/SubmitShopBuyOrderCommandHandler.cs index 4213685..9888cbc 100644 --- a/src/FrontOffice.BFF.Application/UserOrderCQ/Commands/SubmitShopBuyOrder/SubmitShopBuyOrderCommandHandler.cs +++ b/src/FrontOffice.BFF.Application/UserOrderCQ/Commands/SubmitShopBuyOrder/SubmitShopBuyOrderCommandHandler.cs @@ -1,16 +1,28 @@ +using CMSMicroservice.Protobuf.Protos.UserOrder; + namespace FrontOffice.BFF.Application.UserOrderCQ.Commands.SubmitShopBuyOrder; -public class SubmitShopBuyOrderCommandHandler : IRequestHandler + +public class + SubmitShopBuyOrderCommandHandler : IRequestHandler { private readonly IApplicationContractContext _context; + private readonly ICurrentUserService _currentUserService; - public SubmitShopBuyOrderCommandHandler(IApplicationContractContext context) + public SubmitShopBuyOrderCommandHandler(IApplicationContractContext context, ICurrentUserService currentUserService) { _context = context; + _currentUserService = currentUserService; } - public async Task Handle(SubmitShopBuyOrderCommand request, CancellationToken cancellationToken) + public async Task Handle(SubmitShopBuyOrderCommand request, + CancellationToken cancellationToken) { - //TODO: Implement your business logic - return new SubmitShopBuyOrderResponseDto(); + var result = await _context.UserOrder.SubmitShopBuyOrderAsync(new SubmitShopBuyOrderRequest() + { + UserId = _currentUserService.UserId.Value, + TotalAmount = request.TotalAmount + }, cancellationToken: cancellationToken); + return result.Adapt(); + // return new SubmitShopBuyOrderResponseDto(); } -} +} \ No newline at end of file diff --git a/src/FrontOffice.BFF.Application/UserOrderCQ/Commands/SubmitShopBuyOrder/SubmitShopBuyOrderResponseDto.cs b/src/FrontOffice.BFF.Application/UserOrderCQ/Commands/SubmitShopBuyOrder/SubmitShopBuyOrderResponseDto.cs index 9a3b443..293c7b6 100644 --- a/src/FrontOffice.BFF.Application/UserOrderCQ/Commands/SubmitShopBuyOrder/SubmitShopBuyOrderResponseDto.cs +++ b/src/FrontOffice.BFF.Application/UserOrderCQ/Commands/SubmitShopBuyOrder/SubmitShopBuyOrderResponseDto.cs @@ -1,3 +1,7 @@ + + +using FrontOffice.BFF.UserOrder.Protobuf.Protos.UserOrder; + namespace FrontOffice.BFF.Application.UserOrderCQ.Commands.SubmitShopBuyOrder; public class SubmitShopBuyOrderResponseDto { diff --git a/src/FrontOffice.BFF.Application/UserWalletCQ/Queries/GetAllUserWalletChangeLog/GetAllUserWalletChangeLogQueryHandler.cs b/src/FrontOffice.BFF.Application/UserWalletCQ/Queries/GetAllUserWalletChangeLog/GetAllUserWalletChangeLogQueryHandler.cs index 8e9e6a3..ba74da6 100644 --- a/src/FrontOffice.BFF.Application/UserWalletCQ/Queries/GetAllUserWalletChangeLog/GetAllUserWalletChangeLogQueryHandler.cs +++ b/src/FrontOffice.BFF.Application/UserWalletCQ/Queries/GetAllUserWalletChangeLog/GetAllUserWalletChangeLogQueryHandler.cs @@ -1,16 +1,26 @@ +using CMSMicroservice.Protobuf.Protos.UserWalletChangeLog; + namespace FrontOffice.BFF.Application.UserWalletCQ.Queries.GetAllUserWalletChangeLog; public class GetAllUserWalletChangeLogQueryHandler : IRequestHandler { private readonly IApplicationContractContext _context; + private readonly ICurrentUserService _currentUserService; - public GetAllUserWalletChangeLogQueryHandler(IApplicationContractContext context) + public GetAllUserWalletChangeLogQueryHandler(IApplicationContractContext context, ICurrentUserService currentUserService) { _context = context; + _currentUserService = currentUserService; } public async Task Handle(GetAllUserWalletChangeLogQuery request, CancellationToken cancellationToken) { - //TODO: Implement your business logic + await _context.UserWalletChangeLog.GetAllUserWalletChangeLogByFilterAsync(new GetAllUserWalletChangeLogByFilterRequest() + { + Filter = new GetAllUserWalletChangeLogByFilterFilter() + { + UserId = _currentUserService.UserId.Value + } + }, cancellationToken: cancellationToken); return new Unit(); } } diff --git a/src/FrontOffice.BFF.Application/UserWalletCQ/Queries/GetUserWallet/GetUserWalletQueryHandler.cs b/src/FrontOffice.BFF.Application/UserWalletCQ/Queries/GetUserWallet/GetUserWalletQueryHandler.cs index 5c9bd59..bab5ac3 100644 --- a/src/FrontOffice.BFF.Application/UserWalletCQ/Queries/GetUserWallet/GetUserWalletQueryHandler.cs +++ b/src/FrontOffice.BFF.Application/UserWalletCQ/Queries/GetUserWallet/GetUserWalletQueryHandler.cs @@ -1,16 +1,32 @@ +using CMSMicroservice.Protobuf.Protos.UserWallet; + namespace FrontOffice.BFF.Application.UserWalletCQ.Queries.GetUserWallet; + public class GetUserWalletQueryHandler : IRequestHandler { private readonly IApplicationContractContext _context; + private readonly ICurrentUserService _currentUserService; - public GetUserWalletQueryHandler(IApplicationContractContext context) + public GetUserWalletQueryHandler(IApplicationContractContext context, ICurrentUserService currentUserService) { _context = context; + _currentUserService = currentUserService; } public async Task Handle(GetUserWalletQuery request, CancellationToken cancellationToken) { - //TODO: Implement your business logic - return new GetUserWalletResponseDto(); + var userWallet = await _context.UserWallet.GetAllUserWalletByFilterAsync(new GetAllUserWalletByFilterRequest() + { + Filter = new GetAllUserWalletByFilterFilter() + { + UserId = _currentUserService.UserId.Value, + } + }); + if (userWallet.Models.Count == 0) + { + throw new NotFoundException("UserWallet", _currentUserService.UserId.Value); + } + + return userWallet.Models.FirstOrDefault().Adapt(); } -} +} \ No newline at end of file diff --git a/src/FrontOffice.BFF.Domain/FrontOffice.BFF.Domain.csproj b/src/FrontOffice.BFF.Domain/FrontOffice.BFF.Domain.csproj index aff86f3..3f29ba5 100644 --- a/src/FrontOffice.BFF.Domain/FrontOffice.BFF.Domain.csproj +++ b/src/FrontOffice.BFF.Domain/FrontOffice.BFF.Domain.csproj @@ -7,7 +7,7 @@ - + diff --git a/src/FrontOffice.BFF.Infrastructure/Services/ApplicationContractContext.cs b/src/FrontOffice.BFF.Infrastructure/Services/ApplicationContractContext.cs index 32612fb..8cb69f8 100644 --- a/src/FrontOffice.BFF.Infrastructure/Services/ApplicationContractContext.cs +++ b/src/FrontOffice.BFF.Infrastructure/Services/ApplicationContractContext.cs @@ -6,6 +6,8 @@ using CMSMicroservice.Protobuf.Protos.UserAddress; using CMSMicroservice.Protobuf.Protos.UserCarts; using CMSMicroservice.Protobuf.Protos.UserContract; using CMSMicroservice.Protobuf.Protos.UserOrder; +using CMSMicroservice.Protobuf.Protos.UserWallet; +using CMSMicroservice.Protobuf.Protos.UserWalletChangeLog; using FrontOffice.BFF.Application.Common.Interfaces; using Microsoft.Extensions.DependencyInjection; using PYMSMicroservice.Protobuf.Protos.Transaction; @@ -54,6 +56,8 @@ public class ApplicationContractContext : IApplicationContractContext public UserOrderContract.UserOrderContractClient UserOrder => GetService(); public OtpTokenContract.OtpTokenContractClient OtpToken => GetService(); + public UserWalletContract.UserWalletContractClient UserWallet => GetService(); + public UserWalletChangeLogContract.UserWalletChangeLogContractClient UserWalletChangeLog => GetService(); #endregion #region PYMS diff --git a/src/FrontOffice.BFF.WebApi/FrontOffice.BFF.WebApi.csproj b/src/FrontOffice.BFF.WebApi/FrontOffice.BFF.WebApi.csproj index 35ebf30..8c14479 100644 --- a/src/FrontOffice.BFF.WebApi/FrontOffice.BFF.WebApi.csproj +++ b/src/FrontOffice.BFF.WebApi/FrontOffice.BFF.WebApi.csproj @@ -23,6 +23,7 @@ + diff --git a/src/FrontOffice.BFF.WebApi/Services/UserOrderService.cs b/src/FrontOffice.BFF.WebApi/Services/UserOrderService.cs index 6d9d42b..ad0c1bb 100644 --- a/src/FrontOffice.BFF.WebApi/Services/UserOrderService.cs +++ b/src/FrontOffice.BFF.WebApi/Services/UserOrderService.cs @@ -1,4 +1,3 @@ -using FrontOffice.BFF.Protobuf.Protos.UserOrder; using FrontOffice.BFF.WebApi.Common.Services; using FrontOffice.BFF.Application.UserOrderCQ.Commands.CreateNewUserOrder; using FrontOffice.BFF.Application.UserOrderCQ.Commands.UpdateUserOrder; @@ -6,6 +5,8 @@ using FrontOffice.BFF.Application.UserOrderCQ.Commands.DeleteUserOrder; using FrontOffice.BFF.Application.UserOrderCQ.Queries.GetUserOrder; using FrontOffice.BFF.Application.UserOrderCQ.Queries.GetAllUserOrderByFilter; using FrontOffice.BFF.Application.UserOrderCQ.Commands.SubmitShopBuyOrder; +using FrontOffice.BFF.UserOrder.Protobuf.Protos.UserOrder; + namespace FrontOffice.BFF.WebApi.Services; public class UserOrderService : UserOrderContract.UserOrderContractBase { diff --git a/src/FrontOffice.BFF.WebApi/Services/UserWalletService.cs b/src/FrontOffice.BFF.WebApi/Services/UserWalletService.cs index 30739a2..3a5d15e 100644 --- a/src/FrontOffice.BFF.WebApi/Services/UserWalletService.cs +++ b/src/FrontOffice.BFF.WebApi/Services/UserWalletService.cs @@ -1,9 +1,10 @@ -using FrontOffice.BFF.Protobuf.Protos.UserWallet; using FrontOffice.BFF.WebApi.Common.Services; using FrontOffice.BFF.Application.UserWalletCQ.Queries.GetAllUserWalletChangeLog; using FrontOffice.BFF.Application.UserWalletCQ.Queries.GetUserWallet; using FrontOffice.BFF.Application.UserWalletCQ.Commands.TransferUserWalletBallance; using FrontOffice.BFF.Application.UserWalletCQ.Commands.WithdrawBalance; +using FrontOffice.BFF.UserWallet.Protobuf.Protos.UserWallet; + namespace FrontOffice.BFF.WebApi.Services; public class UserWalletService : UserWalletContract.UserWalletContractBase { diff --git a/src/FrontOffice.BFF.sln b/src/FrontOffice.BFF.sln index 73e1d3d..ffc4c1b 100644 --- a/src/FrontOffice.BFF.sln +++ b/src/FrontOffice.BFF.sln @@ -26,6 +26,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FrontOffice.BFF.Products.Pr EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FrontOffice.BFF.ShopingCart.Protobuf", "Protobufs\FrontOffice.BFF.ShopingCart.Protobuf\FrontOffice.BFF.ShopingCart.Protobuf.csproj", "{DC61324B-D389-4A1D-B048-D0AA43A6BBE7}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FrontOffice.BFF.UserWallet.Protobuf", "Protobufs\FrontOffice.BFF.UserWallet.Protobuf\FrontOffice.BFF.UserWallet.Protobuf.csproj", "{03F99CE9-F952-47B0-B71A-1F4865E52443}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -76,6 +78,10 @@ Global {DC61324B-D389-4A1D-B048-D0AA43A6BBE7}.Debug|Any CPU.Build.0 = Debug|Any CPU {DC61324B-D389-4A1D-B048-D0AA43A6BBE7}.Release|Any CPU.ActiveCfg = Release|Any CPU {DC61324B-D389-4A1D-B048-D0AA43A6BBE7}.Release|Any CPU.Build.0 = Release|Any CPU + {03F99CE9-F952-47B0-B71A-1F4865E52443}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {03F99CE9-F952-47B0-B71A-1F4865E52443}.Debug|Any CPU.Build.0 = Debug|Any CPU + {03F99CE9-F952-47B0-B71A-1F4865E52443}.Release|Any CPU.ActiveCfg = Release|Any CPU + {03F99CE9-F952-47B0-B71A-1F4865E52443}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -88,5 +94,6 @@ Global {F59861D9-01D6-44C9-85A9-E6050D55D290} = {CA9BF4D6-6729-4011-888E-48F5F739B469} {CB77669F-5B48-4AC6-B20E-A928660E93F8} = {CA9BF4D6-6729-4011-888E-48F5F739B469} {DC61324B-D389-4A1D-B048-D0AA43A6BBE7} = {CA9BF4D6-6729-4011-888E-48F5F739B469} + {03F99CE9-F952-47B0-B71A-1F4865E52443} = {CA9BF4D6-6729-4011-888E-48F5F739B469} EndGlobalSection EndGlobal diff --git a/src/Protobufs/FrontOffice.BFF.UserOrder.Protobuf/Validator/SubmitShopBuyOrderRequestValidator.cs b/src/Protobufs/FrontOffice.BFF.UserOrder.Protobuf/Validator/SubmitShopBuyOrderRequestValidator.cs index 0fd8b42..bb4bee2 100644 --- a/src/Protobufs/FrontOffice.BFF.UserOrder.Protobuf/Validator/SubmitShopBuyOrderRequestValidator.cs +++ b/src/Protobufs/FrontOffice.BFF.UserOrder.Protobuf/Validator/SubmitShopBuyOrderRequestValidator.cs @@ -1,5 +1,5 @@ using FluentValidation; -using FrontOfficeMicroservice.Protobuf.Protos.UserOrder; +using FrontOffice.BFF.UserOrder.Protobuf.Protos.UserOrder; namespace FrontOfficeMicroservice.Protobuf.Validator.UserOrder; public class SubmitShopBuyOrderRequestValidator : AbstractValidator