@things-factory/tax-invoice 6.2.125 → 6.2.129
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/client/pages/tax-invoice-api/tax-invoice-api-page.ts +99 -61
- package/client/pages/tax-invoice-company/tax-invoice-company-importer.ts +0 -10
- package/client/pages/tax-invoice-company/tax-invoice-company-list-page.ts +0 -32
- package/client/pages/tax-invoice-send/tax-invoice-send-page.ts +2 -2
- package/config/config.development.js +13 -0
- package/config/config.production.js +13 -0
- package/dist-client/pages/tax-invoice-api/tax-invoice-api-page.d.ts +3 -2
- package/dist-client/pages/tax-invoice-api/tax-invoice-api-page.js +91 -61
- package/dist-client/pages/tax-invoice-api/tax-invoice-api-page.js.map +1 -1
- package/dist-client/pages/tax-invoice-company/tax-invoice-company-importer.d.ts +2 -11
- package/dist-client/pages/tax-invoice-company/tax-invoice-company-importer.js +0 -10
- package/dist-client/pages/tax-invoice-company/tax-invoice-company-importer.js.map +1 -1
- package/dist-client/pages/tax-invoice-company/tax-invoice-company-list-page.d.ts +0 -8
- package/dist-client/pages/tax-invoice-company/tax-invoice-company-list-page.js +0 -32
- package/dist-client/pages/tax-invoice-company/tax-invoice-company-list-page.js.map +1 -1
- package/dist-client/pages/tax-invoice-send/tax-invoice-send-page.js +2 -2
- package/dist-client/pages/tax-invoice-send/tax-invoice-send-page.js.map +1 -1
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/dist-server/service/tax-invoice-api/tax-invoice-api-mutation.js +20 -12
- package/dist-server/service/tax-invoice-api/tax-invoice-api-mutation.js.map +1 -1
- package/dist-server/service/tax-invoice-api/tax-invoice-api-query.js +13 -7
- package/dist-server/service/tax-invoice-api/tax-invoice-api-query.js.map +1 -1
- package/dist-server/service/tax-invoice-api/tax-invoice-api-type.js +3 -7
- package/dist-server/service/tax-invoice-api/tax-invoice-api-type.js.map +1 -1
- package/dist-server/service/tax-invoice-api/tax-invoice-api.js +9 -21
- package/dist-server/service/tax-invoice-api/tax-invoice-api.js.map +1 -1
- package/dist-server/service/tax-invoice-company/tax-invoice-company-query.js +27 -6
- package/dist-server/service/tax-invoice-company/tax-invoice-company-query.js.map +1 -1
- package/dist-server/service/tax-invoice-company/tax-invoice-company-type.js +55 -5
- package/dist-server/service/tax-invoice-company/tax-invoice-company-type.js.map +1 -1
- package/dist-server/service/tax-invoice-company/tax-invoice-company.js +1 -19
- package/dist-server/service/tax-invoice-company/tax-invoice-company.js.map +1 -1
- package/dist-server/service/unipost-api/tax-invoice-inquiry.js +6 -10
- package/dist-server/service/unipost-api/tax-invoice-inquiry.js.map +1 -1
- package/dist-server/service/unipost-api/tax-invoice-send.js +4 -5
- package/dist-server/service/unipost-api/tax-invoice-send.js.map +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +6 -5
- package/server/service/tax-invoice-api/tax-invoice-api-mutation.ts +34 -20
- package/server/service/tax-invoice-api/tax-invoice-api-query.ts +12 -6
- package/server/service/tax-invoice-api/tax-invoice-api-type.ts +2 -5
- package/server/service/tax-invoice-api/tax-invoice-api.ts +9 -19
- package/server/service/tax-invoice-company/tax-invoice-company-query.ts +24 -5
- package/server/service/tax-invoice-company/tax-invoice-company-type.ts +40 -4
- package/server/service/tax-invoice-company/tax-invoice-company.ts +0 -18
- package/server/service/unipost-api/tax-invoice-inquiry.ts +6 -10
- package/server/service/unipost-api/tax-invoice-send.ts +5 -5
- package/translations/ko.json +1 -0
|
@@ -11,18 +11,26 @@ const tax_invoice_1 = require("../tax-invoice/tax-invoice");
|
|
|
11
11
|
const tax_invoice_send_1 = require("../unipost-api/tax-invoice-send");
|
|
12
12
|
const tax_invoice_util_1 = require("../tax-invoice/tax-invoice-util");
|
|
13
13
|
let TaxInvoiceApiMutation = class TaxInvoiceApiMutation {
|
|
14
|
-
async updateMultipleTaxInvoiceApi(
|
|
14
|
+
async updateMultipleTaxInvoiceApi(patches, context) {
|
|
15
15
|
const { domain, user, tx } = context.state;
|
|
16
|
+
let results = [];
|
|
17
|
+
const _createRecords = patches.filter((patch) => patch.cuFlag.toUpperCase() === '+');
|
|
18
|
+
const _updateRecords = patches.filter((patch) => patch.cuFlag.toUpperCase() === 'M');
|
|
16
19
|
const taxInvoiceApiRepo = tx.getRepository(tax_invoice_api_1.TaxInvoiceApi);
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
20
|
+
if (_createRecords.length > 0) {
|
|
21
|
+
for (let i = 0; i < _createRecords.length; i++) {
|
|
22
|
+
const newRecord = _createRecords[i];
|
|
23
|
+
const result = await taxInvoiceApiRepo.save(Object.assign(Object.assign({}, newRecord), { domain, creator: user, updater: user }));
|
|
24
|
+
results.push(Object.assign(Object.assign({}, result), { cuFlag: '+' }));
|
|
25
|
+
}
|
|
21
26
|
}
|
|
22
|
-
if (
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
27
|
+
if (_updateRecords.length > 0) {
|
|
28
|
+
for (let i = 0; i < _updateRecords.length; i++) {
|
|
29
|
+
const updateRecord = _updateRecords[i];
|
|
30
|
+
const taxAuditResult = await taxInvoiceApiRepo.findOneBy({ id: updateRecord.id });
|
|
31
|
+
const result = await taxInvoiceApiRepo.save(Object.assign(Object.assign(Object.assign({}, taxAuditResult), updateRecord), { updater: user }));
|
|
32
|
+
results.push(Object.assign(Object.assign({}, result), { cuFlag: 'M' }));
|
|
33
|
+
}
|
|
26
34
|
}
|
|
27
35
|
return results;
|
|
28
36
|
}
|
|
@@ -187,11 +195,11 @@ let TaxInvoiceApiMutation = class TaxInvoiceApiMutation {
|
|
|
187
195
|
};
|
|
188
196
|
tslib_1.__decorate([
|
|
189
197
|
(0, type_graphql_1.Directive)('@transaction'),
|
|
190
|
-
(0, type_graphql_1.Mutation)(returns => tax_invoice_api_1.TaxInvoiceApi, { description: 'To modify Tax Invoice Api information' }),
|
|
191
|
-
tslib_1.__param(0, (0, type_graphql_1.Arg)('
|
|
198
|
+
(0, type_graphql_1.Mutation)(returns => [tax_invoice_api_1.TaxInvoiceApi], { description: 'To modify Tax Invoice Api information' }),
|
|
199
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('patches', type => [tax_invoice_api_type_1.TaxInvoiceApiPatch])),
|
|
192
200
|
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
193
201
|
tslib_1.__metadata("design:type", Function),
|
|
194
|
-
tslib_1.__metadata("design:paramtypes", [
|
|
202
|
+
tslib_1.__metadata("design:paramtypes", [Array, Object]),
|
|
195
203
|
tslib_1.__metadata("design:returntype", Promise)
|
|
196
204
|
], TaxInvoiceApiMutation.prototype, "updateMultipleTaxInvoiceApi", null);
|
|
197
205
|
tslib_1.__decorate([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tax-invoice-api-mutation.js","sourceRoot":"","sources":["../../../server/service/tax-invoice-api/tax-invoice-api-mutation.ts"],"names":[],"mappings":";;;;AAAA,+CAAsE;AACtE,qCAA4B;AAE5B,uDAAiD;AACjD,iEAA2E;AAC3E,2EAAqE;AACrE,4DAAiE;AACjE,sEAA2E;AAC3E,sEAAgF;AAGzE,IAAM,qBAAqB,GAA3B,MAAM,qBAAqB;IAG1B,AAAN,KAAK,CAAC,2BAA2B,CAA2C,KAAyB,EAAS,OAAwB;QACpI,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAC1C,MAAM,iBAAiB,GAAG,EAAE,CAAC,aAAa,CAAC,+BAAa,CAAC,CAAA;QACzD,IAAI,OAAO,CAAA;QAEX,IAAI,KAAK,CAAC,MAAM,CAAC,WAAW,EAAE,KAAK,GAAG,EAAE;YACtC,MAAM,MAAM,GAAG,MAAM,iBAAiB,CAAC,IAAI,iCACtC,KAAK,KACR,MAAM,EACN,OAAO,EAAE,IAAI,EACb,OAAO,EAAE,IAAI,IACb,CAAA;YAEF,OAAO,mCAAQ,MAAM,KAAE,MAAM,EAAE,GAAG,GAAE,CAAA;SAC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AO,EAAE,IAAI,CAAC,EAAE,CAAC,yCAAkB,CAAC,CAAA;IAA6B,mBAAA,IAAA,kBAAG,GAAE,CAAA;;6CAA1B,yCAAkB;;wEA4BpG;AAIK;IAFL,IAAA,wBAAS,EAAC,cAAc,CAAC;IACzB,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,WAAW,EAAE,oCAAoC,EAAE,CAAC;IACxD,mBAAA,IAAA,kBAAG,EAAC,KAAK,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAA;IAAiB,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;iEAS7E;AAIK;IAFL,IAAA,wBAAS,EAAC,cAAc,CAAC;IACzB,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,WAAW,EAAE,6BAA6B,EAAE,CAAC;IAE1E,mBAAA,IAAA,kBAAG,EAAC,oBAAoB,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,qCAAc,CAAC,CAAC,CAAA;IACnD,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;iEAgDP;AAlGU,qBAAqB;IADjC,IAAA,uBAAQ,EAAC,+BAAa,CAAC;GACX,qBAAqB,CAgOjC;AAhOY,sDAAqB","sourcesContent":["import { Resolver, Mutation, Arg, Ctx, Directive } from 'type-graphql'\nimport { In } from 'typeorm'\n\nimport { TaxInvoiceApi } from './tax-invoice-api'\nimport { TaxInvoiceApiPatch, TaxInvoiceSend } from './tax-invoice-api-type'\nimport { TaxInvoiceItem } from '../tax-invoice-item/tax-invoice-item'\nimport { Category, TaxInvoice } from '../tax-invoice/tax-invoice'\nimport { sendTaxInvoiceByUniposApi } from '../unipost-api/tax-invoice-send'\nimport { parseTaxInvoiceByUnipostFormat } from '../tax-invoice/tax-invoice-util'\n\n@Resolver(TaxInvoiceApi)\nexport class TaxInvoiceApiMutation {\n @Directive('@transaction')\n @Mutation(returns => TaxInvoiceApi, { description: 'To modify Tax Invoice Api information' })\n async updateMultipleTaxInvoiceApi(@Arg('patch', type => TaxInvoiceApiPatch) patch: TaxInvoiceApiPatch, @Ctx() context: ResolverContext): Promise<TaxInvoiceApi> {\n const { domain, user, tx } = context.state\n const taxInvoiceApiRepo = tx.getRepository(TaxInvoiceApi)\n let results\n\n if (patch.cuFlag.toUpperCase() === '+') {\n const result = await taxInvoiceApiRepo.save({\n ...patch,\n domain,\n creator: user,\n updater: user\n })\n\n results = { ...result, cuFlag: '+' }\n }\n\n if (patch.cuFlag.toUpperCase() === 'M') {\n const taxInvoiceApi = await taxInvoiceApiRepo.findOneBy({ id: patch.id })\n const result = await taxInvoiceApiRepo.save({\n ...taxInvoiceApi,\n ...patch,\n updater: user\n })\n\n results = { ...result, cuFlag: 'M' }\n }\n\n return results\n }\n\n @Directive('@transaction')\n @Mutation(returns => Boolean, { description: 'To delete multiple Tax Invoice Api' })\n async deleteTaxInvoiceApis(@Arg('ids', type => [String]) ids: string[], @Ctx() context: ResolverContext): Promise<boolean> {\n const { domain, tx } = context.state\n\n await tx.getRepository(TaxInvoiceApi).delete({\n domain: { id: domain.id },\n id: In(ids)\n })\n\n return true\n }\n\n @Directive('@transaction')\n @Mutation(returns => Boolean, { description: 'To Send Tax Invoices By Api' })\n async sendTaxInvoicesByApi(\n @Arg('taxInvoiceSendList', type => [TaxInvoiceSend]) taxInvoiceSendList: TaxInvoiceSend[],\n @Ctx() context: ResolverContext\n ): Promise<boolean> {\n if (taxInvoiceSendList.length === 0) throw new Error('tax invoice send exception: no list')\n\n const { domain, user, tx } = context.state\n const taxInvoiceRepo = tx.getRepository(TaxInvoice)\n const taxInvoiceItemRepo = tx.getRepository(TaxInvoiceItem)\n const taxInvoiceApiRepo = tx.getRepository(TaxInvoiceApi)\n\n const apiInfo = (await taxInvoiceApiRepo.find()).at(0)\n const businessRegistrationNumber = apiInfo.businessRegistrationNumber\n const { aid = '', bearer = '', customer_no = '' } = apiInfo?.attributes\n let failCount = 0\n\n // 1. 밸리데이션 및 데이터 파싱\n let newTaxInvoiceSendList = taxInvoiceSendList.map(taxInvoiceSend => this._parseTaxInvoiceSendForApi(taxInvoiceSend, aid, customer_no))\n\n // 2. 세금계산서 발행 API 호출\n const apiResult = await sendTaxInvoiceByUniposApi(businessRegistrationNumber, aid, bearer, newTaxInvoiceSendList)\n\n // 3. 성공하면 세금계산서 DB에 저장\n for (let item of apiResult) {\n if (item?.success) {\n const { taxInvoice, taxInvoiceItems } = parseTaxInvoiceByUnipostFormat(item?.tAliceEntry, item?.tAliceEntry?.tAliceItemList, Category.EXPORT)\n\n // 세금계산서 저장\n const newTaxInvoice = await taxInvoiceRepo.save({\n ...taxInvoice,\n domain,\n creator: user,\n updater: user\n })\n\n // 아이템 저장\n for (const item of taxInvoiceItems) {\n await taxInvoiceItemRepo.save({ ...item, taxInvoice: newTaxInvoice, domain, creator: user })\n }\n } else {\n failCount++\n }\n }\n\n // 실패가 1개라도 있으면 에러\n if (failCount > 0) {\n throw new Error(failCount + '개의 계산서 등록에 실패하였습니다.')\n }\n\n return true\n }\n\n // 유니스포트에 받을수 있는 포맷으로 데이터 파싱\n private _parseTaxInvoiceSendForApi(taxInvoiceSend, aid, customer_no) {\n const { taxInvoice, taxInvoiceItems } = taxInvoiceSend\n let newTaxInvoiceItems: any = []\n const today = new Intl.DateTimeFormat('fr-CA', { timeZone: 'Asia/Seoul' }).format(new Date()) // YYYY-MM-DD\n\n // 필수값 체크\n if (\n !taxInvoice.supplierBusinessRegistrationNumber ||\n !taxInvoice.supplierBusinessName ||\n !taxInvoice.supplierRepresentativeName ||\n !taxInvoice.buyerBusinessRegistrationNumber ||\n !taxInvoice.buyerBusinessName ||\n !taxInvoice.buyerRepresentativeName ||\n !taxInvoice.issueDate\n ) {\n throw new Error('tax invoice send exception: no essential value')\n }\n\n // 작성일자가 오늘 날짜를 넘어가면 에러\n if (taxInvoice.issueDate > today) {\n throw new Error('tax invoice send exception: issueDate error')\n }\n\n // 현금, 수표, 어음, 외상미수금이 있을시 총 합계금액과 금액 동일 체크\n const paymentAmount: number =\n taxInvoice.paymentAmountCash + taxInvoice.paymentAmountCheck + taxInvoice.paymentAmountPromissoryNote + taxInvoice.paymentAmountAccountsReceivable\n\n if (paymentAmount > 0 && paymentAmount !== taxInvoice.totalAmount) {\n throw new Error('tax invoice send exception: summary is not same')\n }\n\n for (let item of taxInvoiceItems) {\n // 아이템 필수값 체크\n if (!item.supplyDate || !item.itemName || !item.quantity || !item.unitPrice) {\n throw new Error('tax invoice send exception: no item essential value')\n }\n\n // 아이템의 일자가 작성일자보다 크면 에러\n if (taxInvoice.issueDate < item.supplyDate) {\n throw new Error('tax invoice send exception: item supplyDate is bigger than issueDate')\n }\n\n newTaxInvoiceItems.push({\n tii_seqnumeric: item.sequence,\n tii_purchaseexpirydatetime: item.supplyDate.replace(/-/g, ''),\n tii_nametext: item.itemName,\n tii_informationtext: item.specification,\n tii_chargeableunitquantity: item.quantity,\n tii_unitprice_unitamount: item.unitPrice,\n tii_invoiceamount: item.supplyPrice,\n tii_totaltax_calcamount: item.taxPrice,\n tii_descriptiontext: item.remark\n })\n }\n\n return {\n aid: aid,\n inv_seq: today.replace(/-/g, '') + customer_no,\n exd_refdoc_id: null,\n tid_issuedatetime: taxInvoice.issueDate.replace(/-/g, ''),\n tid_typecode: taxInvoice.invoiceType,\n tid_purposecode: taxInvoice.purpose,\n tid_amendcode: taxInvoice.revisedReason,\n tid_originalissueid: null,\n tid_desc0: taxInvoice.remark0,\n tid_desc1: null,\n tid_desc2: null,\n tit_alice_specorg_biztypecode: taxInvoice.supplierBusinessRegistrationCategory,\n tit_alice_id: taxInvoice.supplierBusinessRegistrationNumber,\n tit_alice_specorg_taxregid: taxInvoice.supplierBranchIdentification,\n tit_alice_name: taxInvoice.supplierBusinessName,\n tit_alice_specperson_name: taxInvoice.supplierRepresentativeName,\n tit_alice_specaddr_lineone: taxInvoice.supplierAddress,\n tit_alice_typecode: taxInvoice.supplierBusinessType,\n tit_alice_classcode: taxInvoice.supplierIndustryType,\n tit_alice_defcont_deptname: taxInvoice.supplierDepartment,\n tit_alice_defcont_personname: taxInvoice.supplierContactName,\n tit_alice_defcont_telcomm: taxInvoice.supplierContactPhone,\n tit_alice_defcont_uricomm: taxInvoice.supplierContactEmail,\n tit_alice_defcont_cellphone: taxInvoice.supplierContactCellPhone,\n tit_bob_specorg_biztypecode: taxInvoice.buyerBusinessRegistrationCategory,\n tit_bob_id: taxInvoice.buyerBusinessRegistrationNumber,\n tit_bob_specorg_taxregid: taxInvoice.buyerBranchIdentification,\n tit_bob_name: taxInvoice.buyerBusinessName,\n tit_bob_specperson_name: taxInvoice.buyerRepresentativeName,\n tit_bob_specaddr_lineone: taxInvoice.buyerAddress,\n tit_bob_typecode: taxInvoice.buyerBusinessType,\n tit_bob_classcode: taxInvoice.buyerIndustryType,\n tit_bob_1stdefcont_deptname: taxInvoice.buyer1stDepartment,\n tit_bob_1stdefcont_personname: taxInvoice.buyer1stContactName,\n tit_bob_1stdefcont_telcomm: taxInvoice.buyer1stContactPhone,\n tit_bob_1stdefcont_uricomm: taxInvoice.buyer1stContactEmail,\n tit_bob_1stdefcont_cellphone: taxInvoice.buyer1stContactCellPhone,\n tit_bob_2nddefcont_deptname: taxInvoice.buyer2ndDepartment,\n tit_bob_2nddefcont_personname: taxInvoice.buyer2ndContactName,\n tit_bob_2nddefcont_telcomm: taxInvoice.buyer2ndContactPhone,\n tit_bob_2nddefcont_uricomm: taxInvoice.buyer2ndContactEmail,\n tit_bob_2nddefcont_cellphone: taxInvoice.buyer2ndContactCellPhone,\n tit_broker_specorg_biztypecode: taxInvoice.agentBusinessRegistrationCategory,\n tit_broker_id: taxInvoice.agentBusinessRegistrationNumber,\n tit_broker_specorg_taxregid: taxInvoice.agentBranchIdentification,\n tit_broker_name: taxInvoice.agentBusinessName,\n tit_broker_specperson_name: taxInvoice.agentRepresentativeName,\n tit_broker_specaddr_lineone: taxInvoice.agentAddress,\n tit_broker_typecode: taxInvoice.agentBusinessType,\n tit_broker_classcode: taxInvoice.agentIndustryType,\n tit_broker_defcont_deptname: taxInvoice.agentDepartment,\n tit_broker_defcont_personname: taxInvoice.agentContactName,\n tit_broker_defcont_telcomm: taxInvoice.agentContactPhone,\n tit_broker_defcont_uricomm: taxInvoice.agentContactEmail,\n tit_broker_defcont_cellphone: taxInvoice.agentContactCellPhone,\n tit_specpay_paidamount10: taxInvoice.paymentAmountCash,\n tit_specpay_paidamount20: taxInvoice.paymentAmountCheck,\n tit_specpay_paidamount30: taxInvoice.paymentAmountPromissoryNote,\n tit_specpay_paidamount40: taxInvoice.paymentAmountAccountsReceivable,\n tit_specsum_chargeamount: taxInvoice.supplyAmount,\n tit_specsum_taxamount: taxInvoice.taxAmount,\n tit_specsum_grandamount: taxInvoice.totalAmount,\n inv_sign: '',\n biz_tocharlesconfirmstatus: null,\n tAliceItemList: newTaxInvoiceItems\n }\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"tax-invoice-api-mutation.js","sourceRoot":"","sources":["../../../server/service/tax-invoice-api/tax-invoice-api-mutation.ts"],"names":[],"mappings":";;;;AAAA,+CAAsE;AACtE,qCAA4B;AAE5B,uDAAiD;AACjD,iEAA2E;AAC3E,2EAAqE;AACrE,4DAAiE;AACjE,sEAA2E;AAC3E,sEAAgF;AAGzE,IAAM,qBAAqB,GAA3B,MAAM,qBAAqB;IAG1B,AAAN,KAAK,CAAC,2BAA2B,CACe,OAA6B,EACpE,OAAwB;QAE/B,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAE1C,IAAI,OAAO,GAAG,EAAE,CAAA;QAChB,MAAM,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,KAAU,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,WAAW,EAAE,KAAK,GAAG,CAAC,CAAA;QACzF,MAAM,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,KA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C,EAAE,CAAC,OAAO,EAAE,EAAE,WAAW,EAAE,6BAA6B,EAAE,CAAC;IAE1E,mBAAA,IAAA,kBAAG,EAAC,oBAAoB,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,qCAAc,CAAC,CAAC,CAAA;IACnD,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;iEAgDP;AAhHU,qBAAqB;IADjC,IAAA,uBAAQ,EAAC,+BAAa,CAAC;GACX,qBAAqB,CA8OjC;AA9OY,sDAAqB","sourcesContent":["import { Resolver, Mutation, Arg, Ctx, Directive } from 'type-graphql'\nimport { In } from 'typeorm'\n\nimport { TaxInvoiceApi } from './tax-invoice-api'\nimport { TaxInvoiceApiPatch, TaxInvoiceSend } from './tax-invoice-api-type'\nimport { TaxInvoiceItem } from '../tax-invoice-item/tax-invoice-item'\nimport { Category, TaxInvoice } from '../tax-invoice/tax-invoice'\nimport { sendTaxInvoiceByUniposApi } from '../unipost-api/tax-invoice-send'\nimport { parseTaxInvoiceByUnipostFormat } from '../tax-invoice/tax-invoice-util'\n\n@Resolver(TaxInvoiceApi)\nexport class TaxInvoiceApiMutation {\n @Directive('@transaction')\n @Mutation(returns => [TaxInvoiceApi], { description: 'To modify Tax Invoice Api information' })\n async updateMultipleTaxInvoiceApi(\n @Arg('patches', type => [TaxInvoiceApiPatch]) patches: TaxInvoiceApiPatch[],\n @Ctx() context: ResolverContext\n ): Promise<TaxInvoiceApi[]> {\n const { domain, user, tx } = context.state\n\n let results = []\n const _createRecords = patches.filter((patch: any) => patch.cuFlag.toUpperCase() === '+')\n const _updateRecords = patches.filter((patch: any) => patch.cuFlag.toUpperCase() === 'M')\n const taxInvoiceApiRepo = tx.getRepository(TaxInvoiceApi)\n\n if (_createRecords.length > 0) {\n for (let i = 0; i < _createRecords.length; i++) {\n const newRecord = _createRecords[i]\n\n const result = await taxInvoiceApiRepo.save({\n ...newRecord,\n domain,\n creator: user,\n updater: user\n })\n\n results.push({ ...result, cuFlag: '+' })\n }\n }\n\n if (_updateRecords.length > 0) {\n for (let i = 0; i < _updateRecords.length; i++) {\n const updateRecord = _updateRecords[i]\n const taxAuditResult = await taxInvoiceApiRepo.findOneBy({ id: updateRecord.id })\n\n const result = await taxInvoiceApiRepo.save({\n ...taxAuditResult,\n ...updateRecord,\n updater: user\n })\n\n results.push({ ...result, cuFlag: 'M' })\n }\n }\n\n return results\n }\n\n @Directive('@transaction')\n @Mutation(returns => Boolean, { description: 'To delete multiple Tax Invoice Api' })\n async deleteTaxInvoiceApis(@Arg('ids', type => [String]) ids: string[], @Ctx() context: ResolverContext): Promise<boolean> {\n const { domain, tx } = context.state\n\n await tx.getRepository(TaxInvoiceApi).delete({\n domain: { id: domain.id },\n id: In(ids)\n })\n\n return true\n }\n\n @Directive('@transaction')\n @Mutation(returns => Boolean, { description: 'To Send Tax Invoices By Api' })\n async sendTaxInvoicesByApi(\n @Arg('taxInvoiceSendList', type => [TaxInvoiceSend]) taxInvoiceSendList: TaxInvoiceSend[],\n @Ctx() context: ResolverContext\n ): Promise<boolean> {\n if (taxInvoiceSendList.length === 0) throw new Error('tax invoice send exception: no list')\n\n const { domain, user, tx } = context.state\n const taxInvoiceRepo = tx.getRepository(TaxInvoice)\n const taxInvoiceItemRepo = tx.getRepository(TaxInvoiceItem)\n const taxInvoiceApiRepo = tx.getRepository(TaxInvoiceApi)\n\n const apiInfo = (await taxInvoiceApiRepo.find()).at(0)\n const businessRegistrationNumber = apiInfo.businessRegistrationNumber\n const { aid = '', bearer = '', customer_no = '' } = apiInfo?.attributes\n let failCount = 0\n\n // 1. 밸리데이션 및 데이터 파싱\n let newTaxInvoiceSendList = taxInvoiceSendList.map(taxInvoiceSend => this._parseTaxInvoiceSendForApi(taxInvoiceSend, aid, customer_no))\n\n // 2. 세금계산서 발행 API 호출\n const apiResult = await sendTaxInvoiceByUniposApi(businessRegistrationNumber, aid, bearer, newTaxInvoiceSendList)\n\n // 3. 성공하면 세금계산서 DB에 저장\n for (let item of apiResult) {\n if (item?.success) {\n const { taxInvoice, taxInvoiceItems } = parseTaxInvoiceByUnipostFormat(item?.tAliceEntry, item?.tAliceEntry?.tAliceItemList, Category.EXPORT)\n\n // 세금계산서 저장\n const newTaxInvoice = await taxInvoiceRepo.save({\n ...taxInvoice,\n domain,\n creator: user,\n updater: user\n })\n\n // 아이템 저장\n for (const item of taxInvoiceItems) {\n await taxInvoiceItemRepo.save({ ...item, taxInvoice: newTaxInvoice, domain, creator: user })\n }\n } else {\n failCount++\n }\n }\n\n // 실패가 1개라도 있으면 에러\n if (failCount > 0) {\n throw new Error(failCount + '개의 계산서 등록에 실패하였습니다.')\n }\n\n return true\n }\n\n // 유니스포트에 받을수 있는 포맷으로 데이터 파싱\n private _parseTaxInvoiceSendForApi(taxInvoiceSend, aid, customer_no) {\n const { taxInvoice, taxInvoiceItems } = taxInvoiceSend\n let newTaxInvoiceItems: any = []\n const today = new Intl.DateTimeFormat('fr-CA', { timeZone: 'Asia/Seoul' }).format(new Date()) // YYYY-MM-DD\n\n // 필수값 체크\n if (\n !taxInvoice.supplierBusinessRegistrationNumber ||\n !taxInvoice.supplierBusinessName ||\n !taxInvoice.supplierRepresentativeName ||\n !taxInvoice.buyerBusinessRegistrationNumber ||\n !taxInvoice.buyerBusinessName ||\n !taxInvoice.buyerRepresentativeName ||\n !taxInvoice.issueDate\n ) {\n throw new Error('tax invoice send exception: no essential value')\n }\n\n // 작성일자가 오늘 날짜를 넘어가면 에러\n if (taxInvoice.issueDate > today) {\n throw new Error('tax invoice send exception: issueDate error')\n }\n\n // 현금, 수표, 어음, 외상미수금이 있을시 총 합계금액과 금액 동일 체크\n const paymentAmount: number =\n taxInvoice.paymentAmountCash + taxInvoice.paymentAmountCheck + taxInvoice.paymentAmountPromissoryNote + taxInvoice.paymentAmountAccountsReceivable\n\n if (paymentAmount > 0 && paymentAmount !== taxInvoice.totalAmount) {\n throw new Error('tax invoice send exception: summary is not same')\n }\n\n for (let item of taxInvoiceItems) {\n // 아이템 필수값 체크\n if (!item.supplyDate || !item.itemName || !item.quantity || !item.unitPrice) {\n throw new Error('tax invoice send exception: no item essential value')\n }\n\n // 아이템의 일자가 작성일자보다 크면 에러\n if (taxInvoice.issueDate < item.supplyDate) {\n throw new Error('tax invoice send exception: item supplyDate is bigger than issueDate')\n }\n\n newTaxInvoiceItems.push({\n tii_seqnumeric: item.sequence,\n tii_purchaseexpirydatetime: item.supplyDate.replace(/-/g, ''),\n tii_nametext: item.itemName,\n tii_informationtext: item.specification,\n tii_chargeableunitquantity: item.quantity,\n tii_unitprice_unitamount: item.unitPrice,\n tii_invoiceamount: item.supplyPrice,\n tii_totaltax_calcamount: item.taxPrice,\n tii_descriptiontext: item.remark\n })\n }\n\n return {\n aid: aid,\n inv_seq: today.replace(/-/g, '') + customer_no,\n exd_refdoc_id: null,\n tid_issuedatetime: taxInvoice.issueDate.replace(/-/g, ''),\n tid_typecode: taxInvoice.invoiceType,\n tid_purposecode: taxInvoice.purpose,\n tid_amendcode: taxInvoice.revisedReason,\n tid_originalissueid: null,\n tid_desc0: taxInvoice.remark0,\n tid_desc1: null,\n tid_desc2: null,\n tit_alice_specorg_biztypecode: taxInvoice.supplierBusinessRegistrationCategory,\n tit_alice_id: taxInvoice.supplierBusinessRegistrationNumber,\n tit_alice_specorg_taxregid: taxInvoice.supplierBranchIdentification,\n tit_alice_name: taxInvoice.supplierBusinessName,\n tit_alice_specperson_name: taxInvoice.supplierRepresentativeName,\n tit_alice_specaddr_lineone: taxInvoice.supplierAddress,\n tit_alice_typecode: taxInvoice.supplierBusinessType,\n tit_alice_classcode: taxInvoice.supplierIndustryType,\n tit_alice_defcont_deptname: taxInvoice.supplierDepartment,\n tit_alice_defcont_personname: taxInvoice.supplierContactName,\n tit_alice_defcont_telcomm: taxInvoice.supplierContactPhone,\n tit_alice_defcont_uricomm: taxInvoice.supplierContactEmail,\n tit_alice_defcont_cellphone: taxInvoice.supplierContactCellPhone,\n tit_bob_specorg_biztypecode: taxInvoice.buyerBusinessRegistrationCategory,\n tit_bob_id: taxInvoice.buyerBusinessRegistrationNumber,\n tit_bob_specorg_taxregid: taxInvoice.buyerBranchIdentification,\n tit_bob_name: taxInvoice.buyerBusinessName,\n tit_bob_specperson_name: taxInvoice.buyerRepresentativeName,\n tit_bob_specaddr_lineone: taxInvoice.buyerAddress,\n tit_bob_typecode: taxInvoice.buyerBusinessType,\n tit_bob_classcode: taxInvoice.buyerIndustryType,\n tit_bob_1stdefcont_deptname: taxInvoice.buyer1stDepartment,\n tit_bob_1stdefcont_personname: taxInvoice.buyer1stContactName,\n tit_bob_1stdefcont_telcomm: taxInvoice.buyer1stContactPhone,\n tit_bob_1stdefcont_uricomm: taxInvoice.buyer1stContactEmail,\n tit_bob_1stdefcont_cellphone: taxInvoice.buyer1stContactCellPhone,\n tit_bob_2nddefcont_deptname: taxInvoice.buyer2ndDepartment,\n tit_bob_2nddefcont_personname: taxInvoice.buyer2ndContactName,\n tit_bob_2nddefcont_telcomm: taxInvoice.buyer2ndContactPhone,\n tit_bob_2nddefcont_uricomm: taxInvoice.buyer2ndContactEmail,\n tit_bob_2nddefcont_cellphone: taxInvoice.buyer2ndContactCellPhone,\n tit_broker_specorg_biztypecode: taxInvoice.agentBusinessRegistrationCategory,\n tit_broker_id: taxInvoice.agentBusinessRegistrationNumber,\n tit_broker_specorg_taxregid: taxInvoice.agentBranchIdentification,\n tit_broker_name: taxInvoice.agentBusinessName,\n tit_broker_specperson_name: taxInvoice.agentRepresentativeName,\n tit_broker_specaddr_lineone: taxInvoice.agentAddress,\n tit_broker_typecode: taxInvoice.agentBusinessType,\n tit_broker_classcode: taxInvoice.agentIndustryType,\n tit_broker_defcont_deptname: taxInvoice.agentDepartment,\n tit_broker_defcont_personname: taxInvoice.agentContactName,\n tit_broker_defcont_telcomm: taxInvoice.agentContactPhone,\n tit_broker_defcont_uricomm: taxInvoice.agentContactEmail,\n tit_broker_defcont_cellphone: taxInvoice.agentContactCellPhone,\n tit_specpay_paidamount10: taxInvoice.paymentAmountCash,\n tit_specpay_paidamount20: taxInvoice.paymentAmountCheck,\n tit_specpay_paidamount30: taxInvoice.paymentAmountPromissoryNote,\n tit_specpay_paidamount40: taxInvoice.paymentAmountAccountsReceivable,\n tit_specsum_chargeamount: taxInvoice.supplyAmount,\n tit_specsum_taxamount: taxInvoice.taxAmount,\n tit_specsum_grandamount: taxInvoice.totalAmount,\n inv_sign: '',\n biz_tocharlesconfirmstatus: null,\n tAliceItemList: newTaxInvoiceItems\n }\n }\n}\n"]}
|
|
@@ -6,12 +6,17 @@ const type_graphql_1 = require("type-graphql");
|
|
|
6
6
|
const shell_1 = require("@things-factory/shell");
|
|
7
7
|
const auth_base_1 = require("@things-factory/auth-base");
|
|
8
8
|
const tax_invoice_api_1 = require("./tax-invoice-api");
|
|
9
|
+
const tax_invoice_api_type_1 = require("./tax-invoice-api-type");
|
|
9
10
|
let TaxInvoiceApiQuery = class TaxInvoiceApiQuery {
|
|
10
|
-
async
|
|
11
|
+
async taxInvoiceApis(params, context) {
|
|
11
12
|
const { domain } = context.state;
|
|
12
|
-
|
|
13
|
-
|
|
13
|
+
const queryBuilder = (0, shell_1.getQueryBuilderFromListParams)({
|
|
14
|
+
domain,
|
|
15
|
+
params,
|
|
16
|
+
repository: await (0, shell_1.getRepository)(tax_invoice_api_1.TaxInvoiceApi)
|
|
14
17
|
});
|
|
18
|
+
const [items, total] = await queryBuilder.getManyAndCount();
|
|
19
|
+
return { items, total };
|
|
15
20
|
}
|
|
16
21
|
async domain(taxInvoiceApi) {
|
|
17
22
|
return taxInvoiceApi.domainId && (await (0, shell_1.getRepository)(shell_1.Domain).findOneBy({ id: taxInvoiceApi.domainId }));
|
|
@@ -24,12 +29,13 @@ let TaxInvoiceApiQuery = class TaxInvoiceApiQuery {
|
|
|
24
29
|
}
|
|
25
30
|
};
|
|
26
31
|
tslib_1.__decorate([
|
|
27
|
-
(0, type_graphql_1.Query)(returns =>
|
|
28
|
-
tslib_1.__param(0, (0, type_graphql_1.
|
|
32
|
+
(0, type_graphql_1.Query)(returns => tax_invoice_api_type_1.TaxInvoiceApiList, { nullable: true, description: 'To fetch a Tax Invoice Api List' }),
|
|
33
|
+
tslib_1.__param(0, (0, type_graphql_1.Args)()),
|
|
34
|
+
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
29
35
|
tslib_1.__metadata("design:type", Function),
|
|
30
|
-
tslib_1.__metadata("design:paramtypes", [Object]),
|
|
36
|
+
tslib_1.__metadata("design:paramtypes", [shell_1.ListParam, Object]),
|
|
31
37
|
tslib_1.__metadata("design:returntype", Promise)
|
|
32
|
-
], TaxInvoiceApiQuery.prototype, "
|
|
38
|
+
], TaxInvoiceApiQuery.prototype, "taxInvoiceApis", null);
|
|
33
39
|
tslib_1.__decorate([
|
|
34
40
|
(0, type_graphql_1.FieldResolver)(type => shell_1.Domain),
|
|
35
41
|
tslib_1.__param(0, (0, type_graphql_1.Root)()),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tax-invoice-api-query.js","sourceRoot":"","sources":["../../../server/service/tax-invoice-api/tax-invoice-api-query.ts"],"names":[],"mappings":";;;;AAAA,+
|
|
1
|
+
{"version":3,"file":"tax-invoice-api-query.js","sourceRoot":"","sources":["../../../server/service/tax-invoice-api/tax-invoice-api-query.ts"],"names":[],"mappings":";;;;AAAA,+CAA8E;AAC9E,iDAAuG;AACvG,yDAAgD;AAChD,uDAAiD;AACjD,iEAA0D;AAGnD,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;IAEvB,AAAN,KAAK,CAAC,cAAc,CAAS,MAAiB,EAAS,OAAwB;QAC7E,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAEhC,MAAM,YAAY,GAAG,IAAA,qCAA6B,EAAC;YACjD,MAAM;YACN,MAAM;YACN,UAAU,EAAE,MAAM,IAAA,qBAAa,EAAC,+BAAa,CAAC;SAC/C,CAAC,CAAA;QACF,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,GAAG,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6CAAgB,+BAAa;;iDAEjD;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAgB,+BAAa;;iDAEjD;AA5BU,kBAAkB;IAD9B,IAAA,uBAAQ,EAAC,+BAAa,CAAC;GACX,kBAAkB,CA6B9B;AA7BY,gDAAkB","sourcesContent":["import { Resolver, Query, FieldResolver, Root, Args, Ctx } from 'type-graphql'\nimport { Domain, ListParam, getQueryBuilderFromListParams, getRepository } from '@things-factory/shell'\nimport { User } from '@things-factory/auth-base'\nimport { TaxInvoiceApi } from './tax-invoice-api'\nimport { TaxInvoiceApiList } from './tax-invoice-api-type'\n\n@Resolver(TaxInvoiceApi)\nexport class TaxInvoiceApiQuery {\n @Query(returns => TaxInvoiceApiList!, { nullable: true, description: 'To fetch a Tax Invoice Api List' })\n async taxInvoiceApis(@Args() params: ListParam, @Ctx() context: ResolverContext): Promise<TaxInvoiceApiList> {\n const { domain } = context.state\n\n const queryBuilder = getQueryBuilderFromListParams({\n domain,\n params,\n repository: await getRepository(TaxInvoiceApi)\n })\n const [items, total] = await queryBuilder.getManyAndCount()\n\n return { items, total }\n }\n\n @FieldResolver(type => Domain)\n async domain(@Root() taxInvoiceApi: TaxInvoiceApi): Promise<Domain> {\n return taxInvoiceApi.domainId && (await getRepository(Domain).findOneBy({ id: taxInvoiceApi.domainId }))\n }\n\n @FieldResolver(type => User)\n async updater(@Root() taxInvoiceApi: TaxInvoiceApi): Promise<User> {\n return taxInvoiceApi.updaterId && (await getRepository(User).findOneBy({ id: taxInvoiceApi.updaterId }))\n }\n\n @FieldResolver(type => User)\n async creator(@Root() taxInvoiceApi: TaxInvoiceApi): Promise<User> {\n return taxInvoiceApi.creatorId && (await getRepository(User).findOneBy({ id: taxInvoiceApi.creatorId }))\n }\n}\n"]}
|
|
@@ -15,16 +15,12 @@ tslib_1.__decorate([
|
|
|
15
15
|
], TaxInvoiceApiPatch.prototype, "id", void 0);
|
|
16
16
|
tslib_1.__decorate([
|
|
17
17
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
18
|
-
tslib_1.__metadata("design:type",
|
|
19
|
-
], TaxInvoiceApiPatch.prototype, "
|
|
20
|
-
tslib_1.__decorate([
|
|
21
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
|
22
|
-
tslib_1.__metadata("design:type", String)
|
|
23
|
-
], TaxInvoiceApiPatch.prototype, "description", void 0);
|
|
18
|
+
tslib_1.__metadata("design:type", Boolean)
|
|
19
|
+
], TaxInvoiceApiPatch.prototype, "isDefault", void 0);
|
|
24
20
|
tslib_1.__decorate([
|
|
25
21
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
26
22
|
tslib_1.__metadata("design:type", String)
|
|
27
|
-
], TaxInvoiceApiPatch.prototype, "
|
|
23
|
+
], TaxInvoiceApiPatch.prototype, "provider", void 0);
|
|
28
24
|
tslib_1.__decorate([
|
|
29
25
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
30
26
|
tslib_1.__metadata("design:type", String)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tax-invoice-api-type.js","sourceRoot":"","sources":["../../../server/service/tax-invoice-api/tax-invoice-api-type.ts"],"names":[],"mappings":";;;;AAAA,+CAAoE;AACpE,uDAAiD;AACjD,iDAAoD;AACpD,sEAA+D;AAC/D,qFAA6E;AAGtE,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;
|
|
1
|
+
{"version":3,"file":"tax-invoice-api-type.js","sourceRoot":"","sources":["../../../server/service/tax-invoice-api/tax-invoice-api-type.ts"],"names":[],"mappings":";;;;AAAA,+CAAoE;AACpE,uDAAiD;AACjD,iDAAoD;AACpD,sEAA+D;AAC/D,qFAA6E;AAGtE,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;CAyD9B,CAAA;AAxDC;IAAC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,EAAE,E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AAQ,EAAE,IAAI,EAAE,CAAC;;4DACD;AAEzB;IAAC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,oBAAY,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;sDAChC;AAEhB;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;kDACX;AAxDJ,kBAAkB;IAD9B,IAAA,wBAAS,GAAE;GACC,kBAAkB,CAyD9B;AAzDY,gDAAkB;AA4DxB,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;CAM7B,CAAA;AALC;IAAC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,+BAAa,CAAC,CAAC;;gDACT;AAEtB;IAAC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAG,CAAC;;gDACN;AALF,iBAAiB;IAD7B,IAAA,yBAAU,GAAE;GACA,iBAAiB,CAM7B;AANY,8CAAiB;AASvB,IAAM,cAAc,GAApB,MAAM,cAAc;CAM1B,CAAA;AALC;IAAC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,gCAAa,CAAC;sCAChB,gCAAa;kDAAA;AAE1B;IAAC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,yCAAiB,CAAC,CAAC;;uDACE;AAL1B,cAAc;IAD1B,IAAA,wBAAS,GAAE;GACC,cAAc,CAM1B;AANY,wCAAc","sourcesContent":["import { ObjectType, Field, InputType, Int, ID } from 'type-graphql'\nimport { TaxInvoiceApi } from './tax-invoice-api'\nimport { ScalarObject } from '@things-factory/shell'\nimport { NewTaxInvoice } from '../tax-invoice/tax-invoice-type'\nimport { NewTaxInvoiceItem } from '../tax-invoice-item/tax-invoice-item-type'\n\n@InputType()\nexport class TaxInvoiceApiPatch {\n @Field(type => ID, { nullable: true })\n id?: string\n\n @Field({ nullable: true })\n isDefault?: boolean\n\n @Field({ nullable: true })\n provider?: string\n\n @Field({ nullable: true })\n apiAccountId?: string\n\n @Field({ nullable: true })\n apiAccountPassword?: string\n\n @Field({ nullable: true })\n businessRegistrationNumber?: string\n\n @Field({ nullable: true })\n branchIdentification?: string\n\n @Field({ nullable: true })\n businessName?: string\n\n @Field({ nullable: true })\n representativeName?: string\n\n @Field({ nullable: true })\n address?: string\n\n @Field({ nullable: true })\n businessType?: string\n\n @Field({ nullable: true })\n industryType?: string\n\n @Field({ nullable: true })\n department?: string\n\n @Field({ nullable: true })\n contactName?: string\n\n @Field({ nullable: true })\n contactPhone?: string\n\n @Field({ nullable: true })\n contactEmail?: string\n\n @Field({ nullable: true })\n contactCellPhone?: string\n\n @Field(type => ScalarObject, { nullable: true })\n attributes?: any\n\n @Field({ nullable: true })\n cuFlag?: string\n}\n\n@ObjectType()\nexport class TaxInvoiceApiList {\n @Field(type => [TaxInvoiceApi])\n items: TaxInvoiceApi[]\n\n @Field(type => Int)\n total: number\n}\n\n@InputType()\nexport class TaxInvoiceSend {\n @Field(type => NewTaxInvoice)\n taxInvoice!: NewTaxInvoice\n\n @Field(type => [NewTaxInvoiceItem])\n taxInvoiceItems!: NewTaxInvoiceItem[]\n}\n"]}
|
|
@@ -23,20 +23,15 @@ tslib_1.__decorate([
|
|
|
23
23
|
tslib_1.__metadata("design:type", String)
|
|
24
24
|
], TaxInvoiceApi.prototype, "domainId", void 0);
|
|
25
25
|
tslib_1.__decorate([
|
|
26
|
-
(0,
|
|
27
|
-
(0,
|
|
28
|
-
tslib_1.__metadata("design:type",
|
|
29
|
-
], TaxInvoiceApi.prototype, "
|
|
26
|
+
(0, typeorm_1.Column)({ nullable: true, comment: '디폴트 여부' }),
|
|
27
|
+
(0, type_graphql_1.Field)({ nullable: true, description: '디폴트 여부' }),
|
|
28
|
+
tslib_1.__metadata("design:type", Boolean)
|
|
29
|
+
], TaxInvoiceApi.prototype, "isDefault", void 0);
|
|
30
30
|
tslib_1.__decorate([
|
|
31
|
-
(0,
|
|
32
|
-
(0,
|
|
31
|
+
(0, typeorm_1.Column)({ nullable: false, comment: '공급자' }),
|
|
32
|
+
(0, type_graphql_1.Field)({ nullable: false, description: '공급자' }),
|
|
33
33
|
tslib_1.__metadata("design:type", String)
|
|
34
|
-
], TaxInvoiceApi.prototype, "
|
|
35
|
-
tslib_1.__decorate([
|
|
36
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
|
37
|
-
(0, typeorm_1.Column)({ nullable: true }),
|
|
38
|
-
tslib_1.__metadata("design:type", String)
|
|
39
|
-
], TaxInvoiceApi.prototype, "description", void 0);
|
|
34
|
+
], TaxInvoiceApi.prototype, "provider", void 0);
|
|
40
35
|
tslib_1.__decorate([
|
|
41
36
|
(0, typeorm_1.Column)({ nullable: true, comment: 'API Key', transformer: shell_1.encryptTransformer }),
|
|
42
37
|
(0, type_graphql_1.Field)({ nullable: true, description: 'API Key' }),
|
|
@@ -127,11 +122,6 @@ tslib_1.__decorate([
|
|
|
127
122
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
128
123
|
tslib_1.__metadata("design:type", Date)
|
|
129
124
|
], TaxInvoiceApi.prototype, "updatedAt", void 0);
|
|
130
|
-
tslib_1.__decorate([
|
|
131
|
-
(0, typeorm_1.DeleteDateColumn)(),
|
|
132
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
|
133
|
-
tslib_1.__metadata("design:type", Date)
|
|
134
|
-
], TaxInvoiceApi.prototype, "deletedAt", void 0);
|
|
135
125
|
tslib_1.__decorate([
|
|
136
126
|
(0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
|
|
137
127
|
(0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true }),
|
|
@@ -151,10 +141,8 @@ tslib_1.__decorate([
|
|
|
151
141
|
tslib_1.__metadata("design:type", String)
|
|
152
142
|
], TaxInvoiceApi.prototype, "updaterId", void 0);
|
|
153
143
|
TaxInvoiceApi = tslib_1.__decorate([
|
|
154
|
-
(0, typeorm_1.Entity)(
|
|
155
|
-
,
|
|
156
|
-
(0, typeorm_1.Index)('ix_tax_invoice_api_0', (taxInvoiceApi) => [taxInvoiceApi.domain, taxInvoiceApi.name, taxInvoiceApi.deletedAt]),
|
|
157
|
-
(0, typeorm_1.Index)('ix_tax_invoice_api_1', (taxInvoiceApi) => [taxInvoiceApi.domain, taxInvoiceApi.description, taxInvoiceApi.deletedAt]),
|
|
144
|
+
(0, typeorm_1.Entity)(),
|
|
145
|
+
(0, typeorm_1.Index)('ix_tax_invoice_api_provider', (taxInvoiceApi) => [taxInvoiceApi.domain, taxInvoiceApi.provider], { unique: true }),
|
|
158
146
|
(0, type_graphql_1.ObjectType)({ description: 'Entity for Tax Invoice Api' })
|
|
159
147
|
], TaxInvoiceApi);
|
|
160
148
|
exports.TaxInvoiceApi = TaxInvoiceApi;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tax-invoice-api.js","sourceRoot":"","sources":["../../../server/service/tax-invoice-api/tax-invoice-api.ts"],"names":[],"mappings":";;;;AAAA,
|
|
1
|
+
{"version":3,"file":"tax-invoice-api.js","sourceRoot":"","sources":["../../../server/service/tax-invoice-api/tax-invoice-api.ts"],"names":[],"mappings":";;;;AAAA,qCAAkI;AAClI,+CAAoD;AAEpD,iDAAgF;AAChF,yDAAgD;AAKzC,IAAM,aAAa,GAAnB,MAAM,aAAa;CAyGzB,CAAA;AAxGC;IAAC,IAAA,gCAAsB,EAAC,MAAM,CAAC;IAC9B,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,CAAC;;yCACE;AAEpB;IAAC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,CAAC;IACzB,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCACjB,cAAM;6CAAA;AAEf;IAAC,IAAA,oBAAU,EAAC,CAAC,aAA4B,EAAE,EAAE,CAAC,aAAa,CAAC,MAAM,CAAC;;+CAClD;AAEjB;IAAC,IAAA,gBAAM,EAAC,EAA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AE,IAAI,EAAE,CAAC;sCACd,IAAI;gDAAA;AAEhB;IAAC,IAAA,0BAAgB,GAAE;IAClB,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCACd,IAAI;gDAAA;AAEhB;IAAC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC3C,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCAC9B,gBAAI;8CAAA;AAEd;IAAC,IAAA,oBAAU,EAAC,CAAC,aAA4B,EAAE,EAAE,CAAC,aAAa,CAAC,OAAO,CAAC;;gDAClD;AAElB;IAAC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC3C,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCAC9B,gBAAI;8CAAA;AAEd;IAAC,IAAA,oBAAU,EAAC,CAAC,aAA4B,EAAE,EAAE,CAAC,aAAa,CAAC,OAAO,CAAC;;gDAClD;AAxGP,aAAa;IAHzB,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,EAAC,6BAA6B,EAAE,CAAC,aAA4B,EAAE,EAAE,CAAC,CAAC,aAAa,CAAC,MAAM,EAAE,aAAa,CAAC,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IACxI,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,4BAA4B,EAAE,CAAC;GAC7C,aAAa,CAyGzB;AAzGY,sCAAa","sourcesContent":["import { CreateDateColumn, UpdateDateColumn, Entity, Index, Column, RelationId, ManyToOne, PrimaryGeneratedColumn } from 'typeorm'\nimport { ObjectType, Field, ID } from 'type-graphql'\n\nimport { Domain, ScalarObject, encryptTransformer } from '@things-factory/shell'\nimport { User } from '@things-factory/auth-base'\n\n@Entity()\n@Index('ix_tax_invoice_api_provider', (taxInvoiceApi: TaxInvoiceApi) => [taxInvoiceApi.domain, taxInvoiceApi.provider], { unique: true })\n@ObjectType({ description: 'Entity for Tax Invoice Api' })\nexport class TaxInvoiceApi {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID)\n readonly id!: string\n\n @ManyToOne(type => Domain)\n @Field({ nullable: true })\n domain?: Domain\n\n @RelationId((taxInvoiceApi: TaxInvoiceApi) => taxInvoiceApi.domain)\n domainId?: string\n\n @Column({ nullable: true, comment: '디폴트 여부' })\n @Field({ nullable: true, description: '디폴트 여부' })\n isDefault?: boolean\n\n @Column({ nullable: false, comment: '공급자' })\n @Field({ nullable: false, description: '공급자' })\n provider!: string\n\n @Column({ nullable: true, comment: 'API Key', transformer: encryptTransformer })\n @Field({ nullable: true, description: 'API Key' })\n apiKey?: string\n\n @Column({ nullable: true, comment: 'API 계정 ID', transformer: encryptTransformer })\n @Field({ nullable: true, description: 'API 계정 ID' })\n apiAccountId?: string\n\n @Column({ nullable: true, comment: 'API 계정 비밀번호', transformer: encryptTransformer })\n @Field({ nullable: true, description: 'API 계정 비밀번호' })\n apiAccountPassword?: string\n\n @Column({ nullable: true, comment: '사업자등록번호', transformer: encryptTransformer })\n @Field({ nullable: true, description: '사업자등록번호' })\n businessRegistrationNumber?: string\n\n @Column({ nullable: true, comment: '종사업장 식별 코드' })\n @Field({ nullable: true, description: '종사업장 식별 코드' })\n branchIdentification?: string\n\n @Column({ nullable: true, comment: '사업자명' })\n @Field({ nullable: true, description: '사업자명' })\n businessName?: string\n\n @Column({ nullable: true, comment: '대표자명' })\n @Field({ nullable: true, description: '대표자명' })\n representativeName?: string\n\n @Column({ nullable: true, comment: '주소', transformer: encryptTransformer })\n @Field({ nullable: true, description: '주소' })\n address?: string\n\n @Column({ nullable: true, comment: '업태' })\n @Field({ nullable: true, description: '업태' })\n businessType?: string\n\n @Column({ nullable: true, comment: '업종' })\n @Field({ nullable: true, description: '업종' })\n industryType?: string\n\n @Column({ nullable: true, comment: '담당 부서' })\n @Field({ nullable: true, description: '담당 부서' })\n department?: string\n\n @Column({ nullable: true, comment: '담당자명', transformer: encryptTransformer })\n @Field({ nullable: true, description: '담당자명' })\n contactName?: string\n\n @Column({ nullable: true, comment: '담당자 전화번호', transformer: encryptTransformer })\n @Field({ nullable: true, description: '담당자 전화번호' })\n contactPhone?: string\n\n @Column({ nullable: true, comment: '담당자 이메일', transformer: encryptTransformer })\n @Field({ nullable: true, description: '담당자 이메일' })\n contactEmail?: string\n\n @Column({ nullable: true, comment: '담당자 핸드폰 번호', transformer: encryptTransformer })\n @Field({ nullable: true, description: '담당자 핸드폰 번호' })\n contactCellPhone?: string\n\n @Column('simple-json', { nullable: true })\n @Field(type => ScalarObject, { nullable: true })\n attributes?: any\n\n @CreateDateColumn()\n @Field({ nullable: true })\n createdAt?: Date\n\n @UpdateDateColumn()\n @Field({ nullable: true })\n updatedAt?: Date\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true })\n creator?: User\n\n @RelationId((taxInvoiceApi: TaxInvoiceApi) => taxInvoiceApi.creator)\n creatorId?: string\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true })\n updater?: User\n\n @RelationId((taxInvoiceApi: TaxInvoiceApi) => taxInvoiceApi.updater)\n updaterId?: string\n}\n"]}
|
|
@@ -7,6 +7,7 @@ const shell_1 = require("@things-factory/shell");
|
|
|
7
7
|
const auth_base_1 = require("@things-factory/auth-base");
|
|
8
8
|
const tax_invoice_company_1 = require("./tax-invoice-company");
|
|
9
9
|
const tax_invoice_company_type_1 = require("./tax-invoice-company-type");
|
|
10
|
+
const tax_invoice_api_1 = require("../tax-invoice-api/tax-invoice-api");
|
|
10
11
|
let TaxInvoiceCompanyQuery = class TaxInvoiceCompanyQuery {
|
|
11
12
|
async taxInvoiceCompany(id, context) {
|
|
12
13
|
const { domain } = context.state;
|
|
@@ -25,8 +26,21 @@ let TaxInvoiceCompanyQuery = class TaxInvoiceCompanyQuery {
|
|
|
25
26
|
const [items, total] = await queryBuilder.getManyAndCount();
|
|
26
27
|
return { items, total };
|
|
27
28
|
}
|
|
28
|
-
|
|
29
|
-
|
|
29
|
+
// 프로젝트 마다 구현 (기본 공급자 정보를 리턴하는 리졸버)
|
|
30
|
+
async taxInvoiceDefaultCompany(context) {
|
|
31
|
+
const { domain } = context.state;
|
|
32
|
+
const taxInvoiceApi = await (0, shell_1.getRepository)(tax_invoice_api_1.TaxInvoiceApi).findOne({
|
|
33
|
+
where: { domain: { id: domain.id }, isDefault: true }
|
|
34
|
+
});
|
|
35
|
+
const taxInvoiceCompany = Object.assign({}, taxInvoiceApi);
|
|
36
|
+
return taxInvoiceCompany;
|
|
37
|
+
}
|
|
38
|
+
async taxInvoiceMyCompanies(context) {
|
|
39
|
+
const { domain } = context.state;
|
|
40
|
+
const taxInvoiceApi = await (0, shell_1.getRepository)(tax_invoice_api_1.TaxInvoiceApi).find({
|
|
41
|
+
where: { domain: { id: domain.id } }
|
|
42
|
+
});
|
|
43
|
+
return null;
|
|
30
44
|
}
|
|
31
45
|
async domain(taxInvoiceCompany) {
|
|
32
46
|
return taxInvoiceCompany.domainId && (await (0, shell_1.getRepository)(shell_1.Domain).findOneBy({ id: taxInvoiceCompany.domainId }));
|
|
@@ -55,12 +69,19 @@ tslib_1.__decorate([
|
|
|
55
69
|
tslib_1.__metadata("design:returntype", Promise)
|
|
56
70
|
], TaxInvoiceCompanyQuery.prototype, "taxInvoiceCompanies", null);
|
|
57
71
|
tslib_1.__decorate([
|
|
58
|
-
(0, type_graphql_1.
|
|
59
|
-
tslib_1.__param(0, (0, type_graphql_1.
|
|
72
|
+
(0, type_graphql_1.Query)(returns => tax_invoice_company_type_1.TaxInvoiceMyCompany, { nullable: true, description: 'To fetch a Tax Invoice My Company' }),
|
|
73
|
+
tslib_1.__param(0, (0, type_graphql_1.Ctx)()),
|
|
60
74
|
tslib_1.__metadata("design:type", Function),
|
|
61
|
-
tslib_1.__metadata("design:paramtypes", [
|
|
75
|
+
tslib_1.__metadata("design:paramtypes", [Object]),
|
|
76
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
77
|
+
], TaxInvoiceCompanyQuery.prototype, "taxInvoiceDefaultCompany", null);
|
|
78
|
+
tslib_1.__decorate([
|
|
79
|
+
(0, type_graphql_1.Query)(returns => tax_invoice_company_type_1.TaxInvoiceMyCompany, { nullable: true, description: 'To fetch a Tax Invoice My Companies' }),
|
|
80
|
+
tslib_1.__param(0, (0, type_graphql_1.Ctx)()),
|
|
81
|
+
tslib_1.__metadata("design:type", Function),
|
|
82
|
+
tslib_1.__metadata("design:paramtypes", [Object]),
|
|
62
83
|
tslib_1.__metadata("design:returntype", Promise)
|
|
63
|
-
], TaxInvoiceCompanyQuery.prototype, "
|
|
84
|
+
], TaxInvoiceCompanyQuery.prototype, "taxInvoiceMyCompanies", null);
|
|
64
85
|
tslib_1.__decorate([
|
|
65
86
|
(0, type_graphql_1.FieldResolver)(type => shell_1.Domain),
|
|
66
87
|
tslib_1.__param(0, (0, type_graphql_1.Root)()),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tax-invoice-company-query.js","sourceRoot":"","sources":["../../../server/service/tax-invoice-company/tax-invoice-company-query.ts"],"names":[],"mappings":";;;;AAAA,+CAAmF;AACnF,iDAAuG;AACvG,yDAAgD;AAChD,+
|
|
1
|
+
{"version":3,"file":"tax-invoice-company-query.js","sourceRoot":"","sources":["../../../server/service/tax-invoice-company/tax-invoice-company-query.ts"],"names":[],"mappings":";;;;AAAA,+CAAmF;AACnF,iDAAuG;AACvG,yDAAgD;AAChD,+DAAyD;AACzD,yEAAuF;AACvF,wEAAkE;AAG3D,IAAM,sBAAsB,GAA5B,MAAM,sBAAsB;IAE3B,AAAN,KAAK,CAAC,iBAAiB,CAAY,EAAU,EAAS,OAAwB;QAC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,CAAC;IACzE,mBAAA,IAAA,mBAAI,GAAE,CAAA;IAAqB,mBAAA,IAAA,kBAAG,GAAE,CAAA;;6CAAjB,iBAAS;;iEAalD;AAIK;IADL,IAAA,oBAAK,EAAC,OAAO,CAAC,EAAE,CAAC,8CAAmB,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,mCAAmC,EAAE,CAAC;IAC5E,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;sEASpC;AAGK;IADL,IAAA,oBAAK,EAAC,OAAO,CAAC,EAAE,CAAC,8CAAmB,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,qCAAqC,EAAE,CAAC;IACjF,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;mEAOjC;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,CAAC;IAChB,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAoB,uCAAiB;;oDAExD;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAoB,uCAAiB;;qDAEzD;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAoB,uCAAiB;;qDAEzD;AA9DU,sBAAsB;IADlC,IAAA,uBAAQ,EAAC,uCAAiB,CAAC;GACf,sBAAsB,CA+DlC;AA/DY,wDAAsB","sourcesContent":["import { Resolver, Query, FieldResolver, Root, Args, Arg, Ctx } from 'type-graphql'\nimport { Domain, getQueryBuilderFromListParams, getRepository, ListParam } from '@things-factory/shell'\nimport { User } from '@things-factory/auth-base'\nimport { TaxInvoiceCompany } from './tax-invoice-company'\nimport { TaxInvoiceCompanyList, TaxInvoiceMyCompany } from './tax-invoice-company-type'\nimport { TaxInvoiceApi } from '../tax-invoice-api/tax-invoice-api'\n\n@Resolver(TaxInvoiceCompany)\nexport class TaxInvoiceCompanyQuery {\n @Query(returns => TaxInvoiceCompany!, { nullable: true, description: 'To fetch a Tax Invoice Company' })\n async taxInvoiceCompany(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<TaxInvoiceCompany> {\n const { domain } = context.state\n\n return await getRepository(TaxInvoiceCompany).findOne({\n where: { domain: { id: domain.id }, id }\n })\n }\n\n @Query(returns => TaxInvoiceCompanyList, { description: 'To fetch multiple Tax Invoice Companies' })\n async taxInvoiceCompanies(@Args() params: ListParam, @Ctx() context: ResolverContext): Promise<TaxInvoiceCompanyList> {\n const { domain } = context.state\n\n const queryBuilder = getQueryBuilderFromListParams({\n domain,\n params,\n repository: await getRepository(TaxInvoiceCompany),\n searchables: ['name', 'description']\n })\n\n const [items, total] = await queryBuilder.getManyAndCount()\n\n return { items, total }\n }\n\n // 프로젝트 마다 구현 (기본 공급자 정보를 리턴하는 리졸버)\n @Query(returns => TaxInvoiceMyCompany, { nullable: true, description: 'To fetch a Tax Invoice My Company' })\n async taxInvoiceDefaultCompany(@Ctx() context: ResolverContext): Promise<TaxInvoiceMyCompany> {\n const { domain } = context.state\n const taxInvoiceApi = await getRepository(TaxInvoiceApi).findOne({\n where: { domain: { id: domain.id }, isDefault: true }\n })\n\n const taxInvoiceCompany: TaxInvoiceMyCompany = { ...taxInvoiceApi }\n\n return taxInvoiceCompany\n }\n\n @Query(returns => TaxInvoiceMyCompany, { nullable: true, description: 'To fetch a Tax Invoice My Companies' })\n async taxInvoiceMyCompanies(@Ctx() context: ResolverContext): Promise<TaxInvoiceMyCompany> {\n const { domain } = context.state\n const taxInvoiceApi = await getRepository(TaxInvoiceApi).find({\n where: { domain: { id: domain.id } }\n })\n\n return null\n }\n\n @FieldResolver(type => Domain)\n async domain(@Root() taxInvoiceCompany: TaxInvoiceCompany): Promise<Domain> {\n return taxInvoiceCompany.domainId && (await getRepository(Domain).findOneBy({ id: taxInvoiceCompany.domainId }))\n }\n\n @FieldResolver(type => User)\n async updater(@Root() taxInvoiceCompany: TaxInvoiceCompany): Promise<User> {\n return taxInvoiceCompany.updaterId && (await getRepository(User).findOneBy({ id: taxInvoiceCompany.updaterId }))\n }\n\n @FieldResolver(type => User)\n async creator(@Root() taxInvoiceCompany: TaxInvoiceCompany): Promise<User> {\n return taxInvoiceCompany.creatorId && (await getRepository(User).findOneBy({ id: taxInvoiceCompany.creatorId }))\n }\n}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TaxInvoiceCompanyList = exports.TaxInvoiceCompanyPatch = void 0;
|
|
3
|
+
exports.TaxInvoiceCompanyList = exports.TaxInvoiceMyCompany = exports.TaxInvoiceCompanyPatch = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const type_graphql_1 = require("type-graphql");
|
|
6
6
|
const shell_1 = require("@things-factory/shell");
|
|
@@ -19,10 +19,6 @@ tslib_1.__decorate([
|
|
|
19
19
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
20
20
|
tslib_1.__metadata("design:type", String)
|
|
21
21
|
], TaxInvoiceCompanyPatch.prototype, "description", void 0);
|
|
22
|
-
tslib_1.__decorate([
|
|
23
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
|
24
|
-
tslib_1.__metadata("design:type", Number)
|
|
25
|
-
], TaxInvoiceCompanyPatch.prototype, "type", void 0);
|
|
26
22
|
tslib_1.__decorate([
|
|
27
23
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
28
24
|
tslib_1.__metadata("design:type", String)
|
|
@@ -83,6 +79,60 @@ TaxInvoiceCompanyPatch = tslib_1.__decorate([
|
|
|
83
79
|
(0, type_graphql_1.InputType)()
|
|
84
80
|
], TaxInvoiceCompanyPatch);
|
|
85
81
|
exports.TaxInvoiceCompanyPatch = TaxInvoiceCompanyPatch;
|
|
82
|
+
let TaxInvoiceMyCompany = class TaxInvoiceMyCompany {
|
|
83
|
+
};
|
|
84
|
+
tslib_1.__decorate([
|
|
85
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
86
|
+
tslib_1.__metadata("design:type", String)
|
|
87
|
+
], TaxInvoiceMyCompany.prototype, "businessRegistrationNumber", void 0);
|
|
88
|
+
tslib_1.__decorate([
|
|
89
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
90
|
+
tslib_1.__metadata("design:type", String)
|
|
91
|
+
], TaxInvoiceMyCompany.prototype, "branchIdentification", void 0);
|
|
92
|
+
tslib_1.__decorate([
|
|
93
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
94
|
+
tslib_1.__metadata("design:type", String)
|
|
95
|
+
], TaxInvoiceMyCompany.prototype, "businessName", void 0);
|
|
96
|
+
tslib_1.__decorate([
|
|
97
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
98
|
+
tslib_1.__metadata("design:type", String)
|
|
99
|
+
], TaxInvoiceMyCompany.prototype, "representativeName", void 0);
|
|
100
|
+
tslib_1.__decorate([
|
|
101
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
102
|
+
tslib_1.__metadata("design:type", String)
|
|
103
|
+
], TaxInvoiceMyCompany.prototype, "address", void 0);
|
|
104
|
+
tslib_1.__decorate([
|
|
105
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
106
|
+
tslib_1.__metadata("design:type", String)
|
|
107
|
+
], TaxInvoiceMyCompany.prototype, "businessType", void 0);
|
|
108
|
+
tslib_1.__decorate([
|
|
109
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
110
|
+
tslib_1.__metadata("design:type", String)
|
|
111
|
+
], TaxInvoiceMyCompany.prototype, "industryType", void 0);
|
|
112
|
+
tslib_1.__decorate([
|
|
113
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
114
|
+
tslib_1.__metadata("design:type", String)
|
|
115
|
+
], TaxInvoiceMyCompany.prototype, "department", void 0);
|
|
116
|
+
tslib_1.__decorate([
|
|
117
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
118
|
+
tslib_1.__metadata("design:type", String)
|
|
119
|
+
], TaxInvoiceMyCompany.prototype, "contactName", void 0);
|
|
120
|
+
tslib_1.__decorate([
|
|
121
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
122
|
+
tslib_1.__metadata("design:type", String)
|
|
123
|
+
], TaxInvoiceMyCompany.prototype, "contactPhone", void 0);
|
|
124
|
+
tslib_1.__decorate([
|
|
125
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
126
|
+
tslib_1.__metadata("design:type", String)
|
|
127
|
+
], TaxInvoiceMyCompany.prototype, "contactEmail", void 0);
|
|
128
|
+
tslib_1.__decorate([
|
|
129
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
130
|
+
tslib_1.__metadata("design:type", String)
|
|
131
|
+
], TaxInvoiceMyCompany.prototype, "contactCellPhone", void 0);
|
|
132
|
+
TaxInvoiceMyCompany = tslib_1.__decorate([
|
|
133
|
+
(0, type_graphql_1.ObjectType)()
|
|
134
|
+
], TaxInvoiceMyCompany);
|
|
135
|
+
exports.TaxInvoiceMyCompany = TaxInvoiceMyCompany;
|
|
86
136
|
let TaxInvoiceCompanyList = class TaxInvoiceCompanyList {
|
|
87
137
|
};
|
|
88
138
|
tslib_1.__decorate([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tax-invoice-company-type.js","sourceRoot":"","sources":["../../../server/service/tax-invoice-company/tax-invoice-company-type.ts"],"names":[],"mappings":";;;;AAAA,+CAAoE;AACpE,iDAAoD;AACpD,+
|
|
1
|
+
{"version":3,"file":"tax-invoice-company-type.js","sourceRoot":"","sources":["../../../server/service/tax-invoice-company/tax-invoice-company-type.ts"],"names":[],"mappings":";;;;AAAA,+CAAoE;AACpE,iDAAoD;AACpD,+DAAyD;AAGlD,IAAM,sBAAsB,GAA5B,MAAM,sBAAsB;CAmDlC,CAAA;AAlDC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,GAAE;GACA,mBAAmB,CAoC/B;AApCY,kDAAmB;AAuCzB,IAAM,qBAAqB,GAA3B,MAAM,qBAAqB;CAMjC,CAAA;AALC;IAAC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,uCAAiB,CAAC,CAAC;;oDACT;AAE1B;IAAC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAG,CAAC;;oDACN;AALF,qBAAqB;IADjC,IAAA,yBAAU,GAAE;GACA,qBAAqB,CAMjC;AANY,sDAAqB","sourcesContent":["import { ObjectType, Field, InputType, Int, ID } from 'type-graphql'\nimport { ScalarObject } from '@things-factory/shell'\nimport { TaxInvoiceCompany } from './tax-invoice-company'\n\n@InputType()\nexport class TaxInvoiceCompanyPatch {\n @Field(type => ID, { nullable: true })\n id?: string\n\n @Field({ nullable: true })\n name?: string\n\n @Field({ nullable: true })\n description?: string\n\n @Field({ nullable: true })\n businessRegistrationNumber?: string\n\n @Field({ nullable: true })\n branchIdentification?: string\n\n @Field({ nullable: true })\n businessName?: string\n\n @Field({ nullable: true })\n representativeName?: string\n\n @Field({ nullable: true })\n address?: string\n\n @Field({ nullable: true })\n businessType?: string\n\n @Field({ nullable: true })\n industryType?: string\n\n @Field({ nullable: true })\n department?: string\n\n @Field({ nullable: true })\n contactName?: string\n\n @Field({ nullable: true })\n contactPhone?: string\n\n @Field({ nullable: true })\n contactEmail?: string\n\n @Field({ nullable: true })\n contactCellPhone?: string\n\n @Field(type => ScalarObject, { nullable: true })\n attributes?: any\n\n @Field({ nullable: true })\n cuFlag?: string\n}\n\n@ObjectType()\nexport class TaxInvoiceMyCompany {\n @Field({ nullable: true })\n businessRegistrationNumber?: string\n\n @Field({ nullable: true })\n branchIdentification?: string\n\n @Field({ nullable: true })\n businessName?: string\n\n @Field({ nullable: true })\n representativeName?: string\n\n @Field({ nullable: true })\n address?: string\n\n @Field({ nullable: true })\n businessType?: string\n\n @Field({ nullable: true })\n industryType?: string\n\n @Field({ nullable: true })\n department?: string\n\n @Field({ nullable: true })\n contactName?: string\n\n @Field({ nullable: true })\n contactPhone?: string\n\n @Field({ nullable: true })\n contactEmail?: string\n\n @Field({ nullable: true })\n contactCellPhone?: string\n}\n\n@ObjectType()\nexport class TaxInvoiceCompanyList {\n @Field(type => [TaxInvoiceCompany])\n items: TaxInvoiceCompany[]\n\n @Field(type => Int)\n total: number\n}\n"]}
|
|
@@ -1,24 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TaxInvoiceCompany =
|
|
3
|
+
exports.TaxInvoiceCompany = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const typeorm_1 = require("typeorm");
|
|
6
6
|
const type_graphql_1 = require("type-graphql");
|
|
7
7
|
const shell_1 = require("@things-factory/shell");
|
|
8
8
|
const auth_base_1 = require("@things-factory/auth-base");
|
|
9
|
-
var CompanyType;
|
|
10
|
-
(function (CompanyType) {
|
|
11
|
-
CompanyType[CompanyType["SUPPLIER"] = 10] = "SUPPLIER";
|
|
12
|
-
CompanyType[CompanyType["BUYER"] = 20] = "BUYER"; // 거래처
|
|
13
|
-
})(CompanyType = exports.CompanyType || (exports.CompanyType = {}));
|
|
14
|
-
exports.companyTypeLabel = {
|
|
15
|
-
[CompanyType.SUPPLIER]: '공급자',
|
|
16
|
-
[CompanyType.BUYER]: '거래처'
|
|
17
|
-
};
|
|
18
|
-
(0, type_graphql_1.registerEnumType)(CompanyType, {
|
|
19
|
-
name: 'CompanyType',
|
|
20
|
-
description: 'company type'
|
|
21
|
-
});
|
|
22
9
|
let TaxInvoiceCompany = class TaxInvoiceCompany {
|
|
23
10
|
};
|
|
24
11
|
tslib_1.__decorate([
|
|
@@ -45,11 +32,6 @@ tslib_1.__decorate([
|
|
|
45
32
|
(0, typeorm_1.Column)({ nullable: true }),
|
|
46
33
|
tslib_1.__metadata("design:type", String)
|
|
47
34
|
], TaxInvoiceCompany.prototype, "description", void 0);
|
|
48
|
-
tslib_1.__decorate([
|
|
49
|
-
(0, type_graphql_1.Field)({ nullable: false }),
|
|
50
|
-
(0, typeorm_1.Column)({ nullable: false }),
|
|
51
|
-
tslib_1.__metadata("design:type", Number)
|
|
52
|
-
], TaxInvoiceCompany.prototype, "type", void 0);
|
|
53
35
|
tslib_1.__decorate([
|
|
54
36
|
(0, typeorm_1.Column)({ nullable: true, comment: '사업자등록번호', transformer: shell_1.encryptTransformer }),
|
|
55
37
|
(0, type_graphql_1.Field)({ nullable: true, description: '사업자등록번호' }),
|